Xapian:...enerator(3)

πŸ’– Xapian:...enerator(3) β€” Search::Xapian::TermGenerator πŸ’–

okay bestie, welcome to the User Contributed Perl Documentation page for Search::Xapian::TermGenerator β€” aka the Xapian:...enerator(3) glow-up. It’s lowkey iconic: this module parses text and generates terms, and the vibes are very β€œindexing but make it cute.” πŸ’…


✨ NAME ✨

Search::Xapian::TermGenerator β€” parses a piece of text and generates terms. πŸŽ€

🌸 DESCRIPTION 🌸

This module grabs a piece of text, parses it into words, and then uses those words to generate suitable terms for indexing. The terms it generates are suitable for use with Search::Xapian::Query objects produced by the Search::Xapian::QueryParser class. No cap, that’s the whole plot. πŸ¦‹

🧚 SYNOPSIS 🧚

use Search::Xapian;

my $doc = new Search::Xapian::Document();
my $tg = new Search::Xapian::TermGenerator();
$tg->set_stemmer(new Search::Xapian::Stem("english"));
$tg->set_document($doc);
$tg->index_text("The cat sat on the mat");

πŸ’… METHODS πŸ’…

  • new β€” TermGenerator constructor. ✨
  • set_stemmer <stemmer> β€” Set the Search::Xapian::Stem object to be used for generating stemmed terms. 🌱
  • set_stopper <stopper> β€” Set the Search::Xapian::Stopper object to be used for identifying stopwords. πŸ›‘
  • set_document <document> β€” Set the Search::Xapian::Document object to index terms into. πŸ“„
  • get_document <document> β€” Get the currently set Search::Xapian::Document object. πŸ‘€
  • index_text <text> [<wdf_inc> [<prefix>]] β€” Indexes the text in string <text>. The optional parameter <wdf_inc> sets the wdf increment (default 1). The optional parameter <prefix> sets the term prefix to use (default is no prefix). πŸ”₯
  • index_text_without_positions <text> [<wdf_inc> [<prefix>]] β€” Just like index_text, but no positional information is generated. This means that the database will be significantly smaller, but that phrase searching and NEAR won’t be supported. 🫢
  • increase_termpos [<delta>] β€” Increase the termpos used by index_text by <delta> (default 100).

This can be used to prevent phrase searches from spanning two unconnected blocks of text (e.g. the title and body text). 🧠

  • get_termpos β€” Get the current term position. πŸ“
  • set_termpos <termpos> β€” Set the current term position. 🎯
  • get_description β€” Return a description of this object. πŸ’¬

🌈 REFERENCE 🌈

https://xapian.org/docs/sourcedoc/html/classXapian_1_1TermGenerator.html


mwah πŸ’‹ this page is from perl v5.42.0, dated 2022-02-28, and it’s the Xapian:...enerator(3) manual page. periodt. πŸ‘‘

πŸ“¦ where this page comes from