Euspell
The System

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:

src/content/converter.js
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];
The invariant
The "unchanged" test is 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.

CodeDisambiguationTransformation
000NoCommon word, no change
011NoVVZ (3rd-singular present) ending change
012YesNN2 vs VVZ — two different endings
021NoJJ / VVD / VVN ending change
022YesJJ vs VVD / VVN
041NoDoubled consonant before the ending
101NoStem change, one spelling
102 / 103YesStem change, two or three spellings
111NoStem + unambiguous VVZ ending
112–114YesStem + NN2 vs VVZ ending; two to four spellings
121NoStem + JJ / VVD / VVN ending
123YesStem + JJ vs VVD / VVN; three spellings
131NoStem + undoubled consonant
152YesStem change, two spellings (stems not in -ate)
202YesCase-by-case; semantic or part-of-speech sense split
500 / 501 / 511NoRare or archaic words
7xxVariesFrench-derived classes (incl. 702 number pairs)
8xxNoScottish classes — 800 / 811 / 821, one spelling each
900NoAbbreviation — 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:

data/euspell_lexicon.csv
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.