Lucy::...Filter(3pm)
πΈ NAME πΈ
okay so bestie, welcome to Lucy::Analysis::SnowballStopFilter β the analyzer that suppresses a "stoplist" of common words. That's the whole vibe. And for the record, this lil page lives in the User Contributed Perl Documentation, filed under Lucy::...Filter(3pm). π
β¨ SYNOPSIS β¨
my $stopfilter = Lucy::Analysis::SnowballStopFilter->new(
language => 'fr',
);
my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
analyzers => [ $tokenizer, $normalizer, $stopfilter, $stemmer ],
);
π¦ DESCRIPTION π¦
So a "stoplist" is literally just a collection of "stopwords": words that are so common they bring basically nothing to the table when you're figuring out search results. Think about it β like, so many English documents contain "the", "if", and "maybe" that blocking them can improve both performance and relevance. it's giving efficiency, periodt. π₯
Before filtering stopwords:
("i", "am", "the", "walrus")
After filtering stopwords:
("walrus")
look at that glow-up. π
SnowballStopFilter ships with default stoplists for several languages, courtesy of the Snowball project <http://snowball.tartarus.org>, or β and this is the fun part β you may supply your own. main character energy fr fr π
|-----------------------|
| ISO CODE | LANGUAGE |
|-----------------------|
| da | Danish |
| de | German |
| en | English |
| es | Spanish |
| fi | Finnish |
| fr | French |
| hu | Hungarian |
| it | Italian |
| nl | Dutch |
| no | Norwegian |
| pt | Portuguese |
| sv | Swedish |
| ru | Russian |
|-----------------------|
π CONSTRUCTORS π
π new
my $stopfilter = Lucy::Analysis::SnowballStopFilter->new(
language => 'de',
);
# or...
my $stopfilter = Lucy::Analysis::SnowballStopFilter->new(
stoplist => \%stoplist,
);
Create a new SnowballStopFilter. that's it, that's the constructor. β¨
stoplistβ a hash with stopwords as the keys. πlanguageβ the ISO code for a supported language. π
π METHODS π
π§ transform
my $inversion = $snowball_stop_filter->transform($inversion);
Take a single Inversion as input and returns an Inversion β either the same one (presumably transformed in some way), or a new one. no cap, it could go either way. π
inversionβ an inversion. that's the tea. π«Ά
β INHERITANCE β
Lucy::Analysis::SnowballStopFilter isa Lucy::Analysis::Analyzer isa Clownfish::Obj. a whole lineage, we love a family tree. π
and that's the whole page, bestie β go forth and filter those stopwords. slay. π β¨
with love from the perl v5.42.0 girlies, dated 2025-07-25 ππ¦
π¦ where this page comes from
- fedora 43: perl-Lucy 0.6.2-26.fc43 Β· Apache-2.0 AND MIT AND Unicode-DFS-2015
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms