1Lucy::Analysis::SnowbalUlsSetropCFoinlttreirb(u3t)ed PerLlucDyo:c:uAmneanltyastiiso:n:SnowballStopFilter(3)
2
3
4
6 Lucy::Analysis::SnowballStopFilter - Suppress a XstoplistX of common
7 words.
8
10 my $stopfilter = Lucy::Analysis::SnowballStopFilter->new(
11 language => 'fr',
12 );
13 my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
14 analyzers => [ $tokenizer, $normalizer, $stopfilter, $stemmer ],
15 );
16
18 A XstoplistX is collection of XstopwordsX: words which are common
19 enough to be of little value when determining search results. For
20 example, so many documents in English contain XtheX, XifX, and XmaybeX
21 that it may improve both performance and relevance to block them.
22
23 Before filtering stopwords:
24
25 ("i", "am", "the", "walrus")
26
27 After filtering stopwords:
28
29 ("walrus")
30
31 SnowballStopFilter provides default stoplists for several languages,
32 courtesy of the Snowball project <http://snowball.tartarus.org>, or you
33 may supply your own.
34
35 |-----------------------|
36 | ISO CODE | LANGUAGE |
37 |-----------------------|
38 | da | Danish |
39 | de | German |
40 | en | English |
41 | es | Spanish |
42 | fi | Finnish |
43 | fr | French |
44 | hu | Hungarian |
45 | it | Italian |
46 | nl | Dutch |
47 | no | Norwegian |
48 | pt | Portuguese |
49 | sv | Swedish |
50 | ru | Russian |
51 |-----------------------|
52
54 new
55 my $stopfilter = Lucy::Analysis::SnowballStopFilter->new(
56 language => 'de',
57 );
58
59 # or...
60 my $stopfilter = Lucy::Analysis::SnowballStopFilter->new(
61 stoplist => \%stoplist,
62 );
63
64 Create a new SnowballStopFilter.
65
66 • stoplist - A hash with stopwords as the keys.
67
68 • language - The ISO code for a supported language.
69
71 transform
72 my $inversion = $snowball_stop_filter->transform($inversion);
73
74 Take a single Inversion as input and returns an Inversion, either the
75 same one (presumably transformed in some way), or a new one.
76
77 • inversion - An inversion.
78
80 Lucy::Analysis::SnowballStopFilter isa Lucy::Analysis::Analyzer isa
81 Clownfish::Obj.
82
83
84
85perl v5.34.0 2022-01-L2u1cy::Analysis::SnowballStopFilter(3)