Text::English(3pm)
π Text::English π
okay bestie, welcome to Text::English(3pm) β it's from the User Contributed Perl Documentation gang, and it does exactly one iconic thing: Porter's stemming algorithm. that's it, that's the whole slay. β¨
πΈ NAME πΈ
Text::English β Porter's stemming algorithm. no cap, that's literally it. π
π¦ SYNOPSIS π¦
look it's so short, so simple, so demure:
use Text::English;
@stems = Text::English::stem( @words );
you hand it words, it hands you stems. periodt. π
π DESCRIPTION π
so this routine takes the Porter Stemming Algorithm and just... applies it to whatever you passed in, and gives you back the stemmed words. no drama, no fuss.
it's derived from the C program stemmer.c β you know the one, it's chilling in freewais and honestly everywhere else too. and that program came with these notes, which I am keeping in full because receipts matter, bestie:
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.
not me giving you the full bibliography, you're welcome π«Ά
now. the author re-interpreted the areas that use Frakes and Cox's "WordSize" function. their version may misbehave on short words starting with "y" β but they can't actually think of any examples, so like, vibe check passed I guess? π
the step numbers correspond to Frakes and Cox, and they're probably in Porter's article (which the author has not seen β ngl, same energy). Porter's algorithm still has rough spots β think current/currency, and all the -ings words β and the author didn't attempt to cure those. π but! they did add support for the British -ise suffix, so that's a win. π
π NOTES π
this is version 0.1. the author would welcome feedback, especially improvements to the punctuation-stripping step. if you've got ideas, they want them fr fr π
β AUTHOR β
Ian Phillipps <ian@unipalm.pipex.com> β the icon, the legend, the person who did all this π«
π COPYRIGHT π
Copyright Public IP Exchange Ltd (PIPEX). Available for use under the same terms as perl.
and that's the whole page babes π β this was Text::English(3pm) brought to you by perl v5.40.1, dated 2026-01-01. go stem something cute π
β¨
π¦ where this page comes from
- ubuntu resolute: libtext-english-perl 1.606-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtext-english-perl 1.606-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms