Lucy::...alyzer(3pm)
π Lucy::Analysis::PolyAnalyzer β Multiple Analyzers in series π
okay bestie, welcome to the User Contributed Perl Documentation page for Lucy::Analysis::PolyAnalyzer(3pm) β yes that's the whole manual name, we're not being shy about it π«Ά
β¨ SYNOPSIS β¨
my $schema = Lucy::Plan::Schema->new;
my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
analyzers => \@analyzers,
);
my $type = Lucy::Plan::FullTextType->new(
analyzer => $polyanalyzer,
);
$schema->spec_field( name => 'title', type => $type );
$schema->spec_field( name => 'content', type => $type );
πΈ DESCRIPTION πΈ
So a PolyAnalyzer is literally just a series of Analyzers, and each one gets called up in turn to "analyze" the text. Like a little relay race of text-processing, no cap πββοΈπ¨
You've got two vibes here:
- You can hand it the Analyzers yourself, or
- you can specify a supported language, and then a PolyAnalyzer made of a CaseFolder, a RegexTokenizer, and a SnowballStemmer gets generated for you. Iconic, honestly β¨
π¨ The language parameter is DEPRECATED. Use EasyAnalyzer instead. π¨
Here's the roster of supported languages, bestie:
en => English,
da => Danish,
de => German,
es => Spanish,
fi => Finnish,
fr => French,
hu => Hungarian,
it => Italian,
nl => Dutch,
no => Norwegian,
pt => Portuguese,
ro => Romanian,
ru => Russian,
sv => Swedish,
tr => Turkish,
π CONSTRUCTORS π
new
my $tokenizer = Lucy::Analysis::StandardTokenizer->new;
my $normalizer = Lucy::Analysis::Normalizer->new;
my $stemmer = Lucy::Analysis::SnowballStemmer->new( language => 'en' );
my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
analyzers => [ $tokenizer, $normalizer, $stemmer, ], );
Create a new PolyAnalyzer. Slay π
languageβ An ISO code from the list of supported languages. DEPRECATED, use EasyAnalyzer instead.analyzersβ An array of Analyzers. The order of the analyzers matters. Don't put aSnowballStemmerbefore aRegexTokenizer(can't stem whole documents or paragraphs β just individual words), or aSnowballStopFilterafter aSnowballStemmer(stemmed words, e.g. "themselv", will not appear in a stoplist). In general, the sequence should be: tokenize, normalize, stopalize, stem. Periodt. π
π METHODS π
get_analyzers
my $arrayref = $poly_analyzer->get_analyzers();
Getter for "analyzers" member. She's giving accessor energy, as she should π«Ά
transform
my $inversion = $poly_analyzer->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. Mystery behavior, we love that for her π
inversionβ An inversion.
π INHERITANCE π
Lucy::Analysis::PolyAnalyzer isa Lucy::Analysis::Analyzer isa Clownfish::Obj. The family tree is thriving, the lineage is immaculate, the ancestors ate π
and that's the whole page, bestie!! this was Lucy::...alyzer(3pm) from perl v5.42.0, dated 2025-07-25 β go forth and analyze, you absolute main character πβ¨ππ¦πΈ
π¦ 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