Lucy::...Filter(3pm)

πŸ“¦
version 0.6.2 Β· 2 versions
, in fedora 43

🌸 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