Lucy::...Reader(3pm)
β¨ Lucy::Index::LexiconReader β¨
okay bestie, so this page lives in the Lucy::...Reader(3pm) manual (it's User Contributed Perl Documentation, very demure, very cpan), and the actual NAME of the thing we're stanning is Lucy::Index::LexiconReader β it reads Lexicon data. that's the whole vibe. π¦
π NAME
Lucy::Index::LexiconReader β Read Lexicon data. that's it, that's the name, no notes. π
π SYNOPSIS
here's how you slide into its DMs:
my $lex_reader = $seg_reader->obtain("Lucy::Index::LexiconReader");
my $lexicon = $lex_reader->lexicon( field => 'title' );
see? not scary. you obtain the reader, then you ask it for a lexicon. periodt. β¨
πΈ DESCRIPTION
so what does this thing do, you ask? LexiconReader reads term dictionary information. that's the whole job description, and honestly? it ate. π
π₯ ABSTRACT METHODS
these are abstract, which is the polite way of saying "girl you gotta implement these yourself, the base class isn't doing it for you". no cap. π
π lexicon
my $lexicon = $lexicon_reader->lexicon(
field => $field, # required
term => $term, # default: undef
);
Return a new Lexicon for the given "field". Will return undef if either the field is not indexed, or if no documents contain a value for the field. so likeβ¦ undef is the "she's not here right now" of return values. π
fieldβ Field name. required, bestie, don't skip it.termβ Pre-locate the Lexicon to this term.
π’ doc_freq
my $int = $lexicon_reader->doc_freq(
field => $field, # required
term => $term, # required
);
Return the number of documents where the specified term is present. just a lil integer doing its thing. lowkey iconic. π
π METHODS
π§ aggregator
my $result = $lexicon_reader->aggregator(
readers => $readers, # required
offsets => $offsets, # required
);
Return a LexiconReader which merges the output of other LexiconReaders. it's giving group project, but make it functional. π
readersβ An array of LexiconReaders.offsetsβ Doc id start offsets for each reader.
π INHERITANCE
the family tree, if you will:
Lucy::Index::LexiconReader isa Lucy::Index::DataReader isa Clownfish::Obj.
generational excellence, truly. π«Ά
π heads up:lexiconanddoc_freqare abstract β this base class is not out here doing the work for you. don't come for it when you getundefor an unfulfilled promise, okay? anddoc_freqneeds bothfieldandterm, no skimping.
and that's the whole page, bestie!! this was pulled from Lucy::...Reader(3pm) in the User Contributed Perl Documentation, and the footer energy was perl v5.42.0 dated 2025-07-25. mwah. go read some lexicons. π
β¨π
π¦ 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