Lingua...Broken(3pm)
πΈ NAME πΈ
okay so this is the Lingua...Broken(3pm) page from the User Contributed Perl Documentation, and the actual module is Lingua::Stem::EnBroken β Porter's stemming algorithm for 'generic' English. yes, the name is giving chaos, but that's the whole vibe. π
π¦ SYNOPSIS π¦
use Lingua::Stem::EnBroken;
my $stems = Lingua::Stem::EnBroken::stem({ -words => $word_list_reference,
-locale => 'en',
-exceptions => $exceptions_hash,
});
β¨ DESCRIPTION β¨
okay so real talk: this routine MIS-applies the Porter Stemming Algorithm to its parameters and returns the stemmed words. It is an intentionally broken version of Lingua::Stem::En for people who need backwards compatibility with Lingua::Stem 0.30 and Lingua::Stem 0.40. Do not use it if you aren't one of those people. no cap. π
π¨ bestie, this is not a "better stemming" situation β it's a "keep old behavior working" situation. π¨
It is derived from the C program "stemmer.c" as found in freewais and elsewhere, which contains these notes:
Purpose: Implementation of the Porter stemming algorithm documented
in: Porter, M.F., "An Algorithm For Suffix Stripping,"
Program 14 (3), July 1980, pp. 130-137.
Provenance: Written by B. Frakes and C. Cox, 1986.
The author re-interpreted areas that use Frakes and Cox's "WordSize" function. Their version may misbehave on short words starting with "y", but they can't think of any examples. The step numbers correspond to Frakes and Cox, and are probably in Porter's article (which they've not seen). Porter's algorithm still has rough spots (e.g. current/currency, -ings words), which they've not attempted to cure, although they've added support for the British -ise suffix.
π CHANGES π
2003.09.28β Documentation fix2000.09.14β Forked from theLingua::Stem::En.pmmodule to provide a backward compatibly broken version for people needing consistent behavior with 0.30 and 0.40 more than accurate stemming.
π«Ά METHODS π«Ά
stem({ -words => \@words, -locale => 'en', -exceptions => \%exceptions });
Stems a list of passed words using the rules of US English. Returns an anonymous array reference to the stemmed words. slay, but make it stemming. π±
Example:
my $stemmed_words = Lingua::Stem::EnBroken::stem({ -words => \@words,
-locale => 'en',
-exceptions => \%exceptions,
});
stem_caching({ -level => 0|1|2 });
Sets the level of stem caching.
'0'means'no caching'. This is the default level.'1'means'cache per run'. This caches stemming results during a single call to'stem'.'2'means'cache indefinitely'. This caches stemming results until either the process exits or the'clear_stem_cache'method is called.
clear_stem_cache;
Clears the cache of stemmed words
π§ NOTES π§
This code is almost entirely derived from the Porter 2.1 module written by Jim Richardson. iykyk, it's a whole lineage thing. β¨
π SEE ALSO π
Lingua::Stem
π AUTHOR π
Jim Richardson, University of Sydney jimr@maths.usyd.edu.au or http://www.maths.usyd.edu.au:8000/jimr.html
Integration in Lingua::Stem by Jerilyn Franz, FreeRun Technologies, <cpan@jerilyn.info>
π COPYRIGHT π
Jim Richardson, University of Sydney Jerilyn Franz, FreeRun Technologies
This code is freely available under the same terms as Perl.
π BUGS π
the original page has no bug text here, bestie.
π TODO π
and this one's empty too in the original page.
β¨ that's the whole page: source/version is perl v5.42.0, date is 2020-09-27, and the manual is Lingua...Broken(3pm) β mwah π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Lingua-Stem 2.31-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms