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 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