Lucy::...alyzer(3pm)

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

πŸ’– 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 a SnowballStemmer before a RegexTokenizer (can't stem whole documents or paragraphs – just individual words), or a SnowballStopFilter after a SnowballStemmer (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