Plucen...mFilter(3pm)

πŸ“¦
version 1.25 Β· 2 versions
  • 1.25 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.25 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Plucene::Analysis::PorterStemFilter πŸ’–

okay bestie, so this one lives in the Plucene::Analysis family (it's part of User Contributed Perl Documentation, no cap) and its whole vibe is Porter stemming on the token stream. let's get into it πŸŽ€


✨ SYNOPSIS ✨

# isa Plucene::Analysis:::TokenFilter

my $token = $porter_stem_filter->next;

🌸 DESCRIPTION 🌸

so this class transforms the token stream following the Porter stemming algorithm. that's the whole job. it's giving word-glow-up πŸ’…

IMPORTANT NOTE: the input to the stemming filter must already be in lower case, so you're gonna need to use LowerCaseFilter or LowerCaseTokenizer farther down the Tokenizer chain in order for this to work properly! do not skip this, i am begging 🫢

the Porter Stemmer implements the Porter Algorithm for normalization of English words by stripping their extensions, and it's used to generalize the searches. for example, the Porter algorithm maps both 'search' and 'searching' (as well as 'searchnessing') to 'search' such that a query for 'search' will also match documents that contain the word 'searching'. like… the way it just. collapses them all into one. iconic behavior honestly πŸ‘‘

heads up: the Porter algorithm is specific to the English language and may give unpredictable results for other languages. also, make sure to use the same analyzer during the indexing and the searching. consistency is the main character here ✨

you can find more information on the Porter algorithm at www.tartarus.org/~martin/PorterStemmer.

a nice online demonstration of the Porter algorithm is available at www.scs.carleton.ca/~dquesnel/java/stuff/PorterApplet.html. go click around, it's lowkey fun 🌈


πŸ¦‹ METHODS πŸ¦‹

next

my $token = $porter_stem_filter->next;

returns the next input token, after being stemmed. that's it, that's the method, and it ate πŸ”₯


and that's the whole page, bestie!! this gem came to you via perl v5.36.0, dated 2022-12-04, filed under Plucen...mFilter(3pm) in the User Contributed Perl Documentation collection. mwah, go stem something πŸ’‹πŸ’–

πŸ“¦ where this page comes from