Porter Stemmer
Before dictionaries and part-of-speech taggers were cheap to consult, there was a faster way to make "connect", "connected" and "connecting" count as one word: cut the ending off by rule. The Porter stemmer is that method — Martin Porter's 1980 suffix-stripping algorithm for English, still the default stemmer in NLTK.
Rules in five passes
The algorithm runs a word through five ordered phases, each a short list of suffix rewrites applied to the longest matching suffix: "sses" to "ss", "ies" to "i", "ational" to "ate", "ization" to "ize". A measure of the word's alternating vowel-consonant structure guards the aggressive rules so a short stem is not chewed away — "relational" reduces to "relate" while "rational" keeps its ending. There is no lexicon, no tagger and no training data: letters go in, letters come out, deterministically and in microseconds.
What you get, and what you lose
The output is a stem, not a word — "studies" becomes "studi", "happiness" becomes "happi" — which is acceptable in an index nobody reads and unacceptable in anything shown to a user. Two errors are built in: it over-stems, collapsing "universal" and "university" onto "univers", and it under-stems, since no suffix rule connects "ran" to "run".
Why it matters
Collapsing variants shrinks the vocabulary and lifts recall in count-based retrieval — a TF-IDF or BM25 index that stems matches "optimising" to a query for "optimise" instead of missing it. Snowball (Porter2) files down the known rough edges, and lemmatisation does the job properly at higher cost. Neural pipelines skip the step entirely: a subword tokenizer already shares material between inflected forms.
The Porter stemmer is a rule-based suffix-stripping algorithm for English that reduces inflected words to a shared stem — "connecting" and "connected" both to "connect" — in five ordered phases, using no dictionary and no part-of-speech information. The stem need not be a real word: "studies" becomes "studi". It is fast and deterministic, and collapsing variants shrinks the vocabulary and lifts recall in count-based search and retrieval.
Picture someone trimming the ends off words to see whether two of them are really the same word. Cut "connecting", "connected" and "connection" back far enough and all three become "connect". The Porter stemmer is a fixed list of such trimming rules for English, written in 1980 and still used every day. Software runs words through it so that a search for "connect" also turns up pages that only ever say "connected". The trimming is blunt: "studies" comes out as "studi", which is not a word at all. That does not matter, because nobody reads the trimmed version — it only has to come out the same for words that belong together.