Encoding rules
Every word in the lexicon carries a three-digit encoding that describes how it transforms. Read the last digit first: it is the number of reformed spellings the word produces.
The shape of a code
The final digit is the variant count. 0 means the word is unchanged; 1 means a single reformed spelling; a value of 2 or more means the word is ambiguous and the context must choose. The rule the converter applies is simply:
const variants = entry.encoding % 10; if (variants === 0) return word; // unchanged if (variants === 1) return entry.spellings[0]; // one reform // variants >= 2 -> disambiguate from context const i = disambiguate(entry, tokens, idx); return entry.spellings[i];
encoding % 10 === 0 — the encoding is authoritative, not an empty spelling field. When two spellings exist, spellings[0]is the no-context default and the order matches the entry's part-of-speech tags.The encoding table
The leading digits describe the morphology — a stem change, a doubled consonant, an inflectional ending. A rule of thumb: encoding % 10 >= 2 requires a disambiguation function.
| Code | Disambiguation | Transformation |
|---|---|---|
000 | No | Common word, no change |
011 | No | VVZ (3rd-singular present) ending change |
012 | Yes | NN2 vs VVZ — two different endings |
021 | No | JJ / VVD / VVN ending change |
022 | Yes | JJ vs VVD / VVN |
041 | No | Doubled consonant before the ending |
101 | No | Stem change, one spelling |
102 / 103 | Yes | Stem change, two or three spellings |
111 | No | Stem + unambiguous VVZ ending |
112–114 | Yes | Stem + NN2 vs VVZ ending; two to four spellings |
121 | No | Stem + JJ / VVD / VVN ending |
123 | Yes | Stem + JJ vs VVD / VVN; three spellings |
131 | No | Stem + undoubled consonant |
152 | Yes | Stem change, two spellings (stems not in -ate) |
202 | Yes | Case-by-case; semantic or part-of-speech sense split |
500 / 501 / 511 | No | Rare or archaic words |
7xx | Varies | French-derived classes (incl. 702 number pairs) |
8xx | No | Scottish classes — 800 / 811 / 821, one spelling each |
900 | No | Abbreviation — column 4 is an expansion, not a spelling |
900 is the one code that describes no spelling change. Its rows hold an expansion rather than a euspelling — dr,NNB,900,Doctor — and the converter reads abbreviations only for their part-of-speech tags, so dr comes out as dr. That is why the units digit is 0. There are 40 such rows.
Worked examples
Straight from the lexicon:
night,NN1|NNT1|VV0,101,niht # one stem-changed spelling aahed,VVD|VVN,021,aahd # single ending change aardwolves,NN2,101,aardwolvs # stem change on a plural aahs,NN2|VVZ,012,aahs|aahz # ambiguous: noun keeps 'aahs', verb -> 'aahz' does,NN2|VDZ,202,does|duz # sense split: 'does' (deer) vs 'duz' (verb)
In the last two rows the trailing 2signals two candidate spellings; a disambiguation function picks the index that matches the word's role in its sentence.