1Lucy::Analysis::PolyAnaUlsyezrerC(o3n)tributed Perl DocuLmuecnyt:a:tAinoanlysis::PolyAnalyzer(3)
2
3
4
6 Lucy::Analysis::PolyAnalyzer - Multiple Analyzers in series.
7
9 my $schema = Lucy::Plan::Schema->new;
10 my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
11 analyzers => \@analyzers,
12 );
13 my $type = Lucy::Plan::FullTextType->new(
14 analyzer => $polyanalyzer,
15 );
16 $schema->spec_field( name => 'title', type => $type );
17 $schema->spec_field( name => 'content', type => $type );
18
20 A PolyAnalyzer is a series of Analyzers, each of which will be called
21 upon to XanalyzeX text in turn. You can either provide the Analyzers
22 yourself, or you can specify a supported language, in which case a
23 PolyAnalyzer consisting of a CaseFolder, a RegexTokenizer, and a
24 SnowballStemmer will be generated for you.
25
26 The language parameter is DEPRECATED. Use EasyAnalyzer instead.
27
28 Supported languages:
29
30 en => English,
31 da => Danish,
32 de => German,
33 es => Spanish,
34 fi => Finnish,
35 fr => French,
36 hu => Hungarian,
37 it => Italian,
38 nl => Dutch,
39 no => Norwegian,
40 pt => Portuguese,
41 ro => Romanian,
42 ru => Russian,
43 sv => Swedish,
44 tr => Turkish,
45
47 new
48 my $tokenizer = Lucy::Analysis::StandardTokenizer->new;
49 my $normalizer = Lucy::Analysis::Normalizer->new;
50 my $stemmer = Lucy::Analysis::SnowballStemmer->new( language => 'en' );
51 my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
52 analyzers => [ $tokenizer, $normalizer, $stemmer, ], );
53
54 Create a new PolyAnalyzer.
55
56 · language - An ISO code from the list of supported languages.
57 DEPRECATED, use EasyAnalyzer instead.
58
59 · analyzers - An array of Analyzers. The order of the analyzers
60 matters. DonXt put a SnowballStemmer before a RegexTokenizer
61 (canXt stem whole documents or paragraphs X just individual words),
62 or a SnowballStopFilter after a SnowballStemmer (stemmed words,
63 e.g. XthemselvX, will not appear in a stoplist). In general, the
64 sequence should be: tokenize, normalize, stopalize, stem.
65
67 get_analyzers
68 my $arrayref = $poly_analyzer->get_analyzers();
69
70 Getter for XanalyzersX member.
71
72 transform
73 my $inversion = $poly_analyzer->transform($inversion);
74
75 Take a single Inversion as input and returns an Inversion, either the
76 same one (presumably transformed in some way), or a new one.
77
78 · inversion - An inversion.
79
81 Lucy::Analysis::PolyAnalyzer isa Lucy::Analysis::Analyzer isa
82 Clownfish::Obj.
83
84
85
86perl v5.28.0 2018-07-14 Lucy::Analysis::PolyAnalyzer(3)