-
-
27 Feb 2018 08:40:23 UTC
- Distribution: Lucy
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Clone repository
- Issues
- Testers (1251 / 3 / 7)
- Kwalitee
Bus factor: 1- License: apache_2_0
- Perl: v5.8.3
- Activity
24 month- Tools
- Download (1.12MB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- The Apache Lucy Project <dev at lucy dot apache dot org>
- Dependencies
- Clownfish
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Lucy::Analysis::SnowballStopFilter - Suppress a “stoplist” of common words.
SYNOPSIS
my $stopfilter = Lucy::Analysis::SnowballStopFilter->new( language => 'fr', ); my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new( analyzers => [ $tokenizer, $normalizer, $stopfilter, $stemmer ], );
DESCRIPTION
A “stoplist” is collection of “stopwords”: words which are common enough to be of little value when determining search results. For example, so many documents in English contain “the”, “if”, and “maybe” that it may improve both performance and relevance to block them.
Before filtering stopwords:
("i", "am", "the", "walrus")
After filtering stopwords:
("walrus")
SnowballStopFilter provides default stoplists for several languages, courtesy of the Snowball project, or you may supply your own.
|-----------------------| | 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.
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.
inversion - An inversion.
INHERITANCE
Lucy::Analysis::SnowballStopFilter isa Lucy::Analysis::Analyzer isa Clownfish::Obj.
Module Install Instructions
To install Lucy, copy and paste the appropriate command in to your terminal.
cpanm Lucy
perl -MCPAN -e shell install Lucy
For more information on module installation, please visit the detailed CPAN module installation guide.