Stemming vs Lemmatization: Rule-Based Suffix Stripping (2D)

Before a language model ever sees a probability or an embedding, raw text usually passes through a normalization step that collapses inflected forms — "running", "runs", "ran" — toward a single root. This 2D companion renders a word as a flat row of canvas letter tiles, color-coded vowel vs. consonant, and steps through the real Porter stemming algorithm's suffix-stripping rules live, computing the vowel-consonant "measure" m that gates each rule exactly as the 1980 algorithm specifies. A dictionary-based lemmatizer mode runs the same words through a lookup table instead, so you can watch the two normalization strategies diverge — the stemmer's fast rule-chopping versus the lemmatizer's slower but always-valid dictionary answer.