Lucy::...alyzer(3pm)
π Lucy::Analysis::Analyzer β the tea β
okay so bestie, welcome to Lucy::Analysis::Analyzer(3pm) β the manual page you're reading right now, and honestly? it's giving foundations. this is the abstract base class that handles Tokenize/modify/filter text. that's the whole NAME vibe. π
β¨ SYNOPSIS β¨
# Abstract base class.
that's it. that's the synopsis. she's abstract, she's mysterious, she doesn't do the work herself, she makes you do it. main character energy honestly. π
πΈ DESCRIPTION πΈ
so like, an Analyzer is a filter that processes text β transforming it from one form into another. periodt. β¨
for instance? an analyzer might break up a long text into smaller pieces (that's RegexTokenizer, hiii), or it might perform case folding to facilitate case-insensitive search (that's Normalizer, mwah π).
it's giving "text goes in, different text comes out." iykyk.
π CONSTRUCTORS π
new
package MyAnalyzer;
use base qw( Lucy::Analysis::Analyzer );
our %foo;
sub new {
my $self = shift->SUPER::new;
my %args = @_;
$foo{$$self} = $args{foo};
return $self;
}
Abstract constructor, bestie. it takes no arguments. that's it. that's the whole thing. don't come for her asking for args, she has none. π«Ά
π¦ ABSTRACT METHODS π¦
transform
my $inversion = $analyzer->transform($inversion);
okay so this one's the big one β take a single Inversion as input, and return an Inversion. could be the same one (presumably transformed in some way π), or a brand new one. either way, slay.
inversionβ An inversion. yes that's the whole description. she's concise. π
β METHODS β
transform_text
my $inversion = $analyzer->transform_text($text);
this one kicks off an analysis chain, creating an Inversion from string input. the default implementation simply creates an initial Inversion with a single Token, then calls transform(). but occasionally subclasses will provide an optimized implementation which minimizes string copies β overachievers, we love them, no cap. π₯
textβ A string. π
split
my $arrayref = $analyzer->split($text);
Analyze text and return an array of token texts. literally that simple, we stan a straightforward method. β¨
textβ A string. π
dump
my $obj = $analyzer->dump();
Dump the analyzer as hash. π (not that kind of dump bestie, this is the serialization kind.)
Subclasses should call dump() on the superclass. The returned object is a hash which should be populated with parameters of the analyzer.
Returns: A hash containing a description of the analyzer. cute, right?
load
my $obj = $analyzer->load($dump);
Reconstruct an analyzer from a dump. the glow-up in reverse, we love to see it π¦
Subclasses should first call load() on the superclass. The returned object is an analyzer which should be reconstructed by setting the dumped parameters from the hash contained in "dump".
β οΈ note that the invocant analyzer is unused. she's just there for moral support. π
dumpβ A hash.
Returns: An analyzer. iconic.
π INHERITANCE π
Lucy::Analysis::Analyzer isa Clownfish::Obj.
that's the family tree, bestie. she comes from good stock. πΈ
and that's the whole page fr fr π β this was Lucy::...alyzer(3pm) from the perl v5.42.0 release, dated 2025-07-25, brought to you by User Contributed Perl Documentation. go forth and analyze your text, you absolute icon πβ¨
π¦ 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