Lucy::...alizer(3pm)
π NAME π
okay so bestie, listen up β Lucy::Analysis::Normalizer is the one who does Unicode normalization, case folding and accent stripping. that's the whole vibe. periodt. π
she lives in the User Contributed Perl Documentation section of the manual, and this whole page is literally her.
β¨ SYNOPSIS β¨
my $normalizer = Lucy::Analysis::Normalizer->new;
my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
analyzers => [ $tokenizer, $normalizer, $stemmer ],
);
like⦠look at her go 𫢠three little lines and you're already unstoppable.
π¦ DESCRIPTION π¦
so Normalizer is an Analyzer whose whole personality is normalizing tokens to one of the Unicode normalization forms. iconic behavior honestly. πΈ
and if you want, she can also do Unicode case folding and turn accented characters into their base character. lowkey a whole glow-up for your text. β¨
π¨ bestie warning π¨ if you use highlighting, Normalizer should be run after tokenization, because she might add or remove characters. the way she edits mid-conversationβ¦ no cap. π
π CONSTRUCTORS π
π« new
my $normalizer = Lucy::Analysis::Normalizer->new(
normalization_form => 'NFKC',
case_fold => 1,
strip_accents => 0,
);
slay, you're making a brand new Normalizer. here are her lil settings bestie π
normalization_formβ the Unicode normalization form. she can be one of'NFC','NFKC','NFD','NFKD'. default is'NFKC'. πcase_foldβ do the case folding thing. default is true. βstrip_accentsβ strip the accents. default is false. π
π₯ METHODS π₯
π transform
my $inversion = $normalizer->transform($inversion);
she takes a single Inversion as input and hands back an Inversion β either the same one (presumably transformed in some way π) or a new one. either way, she ate. π
inversionβ an Inversion. that's it, that's the whole requirement. π«Ά
π INHERITANCE π
the family tree goes like this, and yes she's giving main character energy at every level:
Lucy::Analysis::Normalizer isa Lucy::Analysis::Analyzer isa Clownfish::Obj.
and that's the whole page bestie!! mwah ππβ¨ this little love letter to Lucy::Analysis::Normalizer came to you courtesy of perl v5.42.0, dated 2025-07-25 β go forth and normalize, iykyk ππ¦πΈ
π¦ 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