Comparisons
How this library differs from
org.atteo:evo-inflector:2.0 (stock outputs reproduced
and measured in this repository). evo-inflector is the compact,
rule-based starting point this project builds on — smaller and
simpler, and the better fit when you don't need the extra coverage
below. Full detail in
docs/comparison.md.
All recorded comparisons
| Dimension | evo-inflector 2.0 | This library |
|---|---|---|
| P1 frozen-lexicon accuracy (36,241 records) | 96.474% (1,278 errors) | 100.000% (0 errors) |
| P1 paired gain (95% CI) | — | +3.5264 pp [+3.3318, +3.7132], 1,278 fixes, 0 regressions |
| P2 family-holdout accuracy (36,241) | 96.474% (1,278 errors) | 97.365% (955 errors; +0.8913 pp; +4 vs historical v1) |
| External UD EWT selected overall / full-vocab seen (2,148) / artifact hit (363) | 98.12% / 98.23% / 94.21% | 98.76% / 98.88% / 96.69%; 98.99% alternative coverage |
| Repeated lookup (fixed workload) | 110.9 ns/op | 81.4 ns/op (0.73×) |
| Compacted regular-word lookup (flattened dispatch) | 59.8 ns/op | 79.4 ns/op (1.33× slower) |
| Concurrent throughput, 4 threads | 20.91M ops/s | 4.82M ops/s (4.34× lower) |
| Runtime dependencies | none | none |
Accuracy, side by side
Same protocol, same records, same run. P1 is the frozen-lexicon dictionary-coverage protocol; P2 hides each lemma's word family; external EWT is a separate corpus with no retraining.
Latency
Arithmetic mean latency in ns/op, lower is better. Repeated lookup uses the release workload; compacted is the flattened-dispatch rerun with its own same-run evo2 reference.
Concurrency
Four threads sharing one immutable instance, throughput over the mixed workload in the same run.
The TypeScript port
The same pipeline also ships as a native TypeScript package in
morphex-ts/. Its numbers below are Node
micro-benchmarks on an Intel Core i5-12500H with Node.js 24.20.0,
not JVM measurements; they are deliberately kept out of the JMH
tables above and are not comparable with them. Only recorded
values appear.
| Node workload | Delta engine | Full engine | Rules-only |
|---|---|---|---|
Repeated lexical word (child) |
111–119 ns | 269–280 ns | 130–139 ns |
Repeated rule word (cat) |
112–118 ns | 174–188 ns | 104–116 ns |
Repeated compound (mother-in-law) |
258–289 ns | 434–457 ns | 358–378 ns |
| Distinct fixture lemmas (4,000 words) | 354–432 ns | 1,006–1,057 ns | 327–355 ns |
analyze() repeated (die) |
258–278 ns | 421–441 ns | 221–228 ns |
The delta engine answers pluralize() from 1,962,900 B
raw / 562,893 B gzip; the full engine is 3,707,556 B raw / 785,131
B gzip; the rules-only entry point ships no data. The delta engine
builds a 1 MiB open-addressed hash index over its 124,883 keys,
taking its rule-word path from 673–678 ns (four binary searches)
through 286–293 ns (one merged binary search) to 112–118 ns.
Provider construction measures 50–51 ms end to end (32–33 ms
parsing, 17–19 ms building the index), down from 77–81 ms before
the construction changes. Method and spread:
morphex-ts/BENCHMARKS.md.
Where the differences come from
-
Lookup and casing in one step. Stock 2.0
reaches its exception table lower-cased but re-cases the result
as a suffix edit:
German → Germen,CHILD → CHILDren. This library separates lookup normalization from output case restoration. -
Lexical exceptions that behave like suffix rules.
carp(invariant) coversscarp;louse → licereachesblouse → blice. This library stores lexical knowledge as whole-word edits and keeps only three productive rules. -
Compounds. Stock 2.0 inflects a different
constituent (
mother-in-laws,attorney generals). This library uses a bounded reviewed table and leaves unmatched input unchanged rather than guessing.
Outputs that differ
| Input | 2.0 | Here |
|---|---|---|
German |
Germen |
Germans |
blouse |
blice |
blouses |
scarp |
scarp |
scarps |
UFO |
UFOes |
UFOs |
mother-in-law |
mother-in-laws |
mothers-in-law |
passer-by |
passer-bies |
passers-by |
CHILD / CITY |
CHILDren / CITIes |
CHILDREN / CITIES |
drive-by |
drive-bies |
drive-bys |
attorney general |
attorney generals |
attorneys general |
Intentional policy differences
| Input | Here | Reason |
|---|---|---|
information |
unchanged | mass-noun policy (MASS) |
person |
people (accepts persons) |
preferred form modelled |
die |
dice (accepts dies) |
ambiguous sense flagged |
user_id, 3.14 |
unchanged (FALLBACK) |
out of scope, reported |
well-known |
unchanged | unmatched compounds not guessed |
Migrate
// before
String plural = org.atteo.evo.inflector.English.plural(word);
// after — build once, share (construction loads the lexicon)
private static final EnglishInflector INFLECTOR = EnglishInflector.standard();
String plural = INFLECTOR.pluralize(word);
No org.atteo.evo.inflector shim ships on purpose (it
would duplicate the API on the benchmark classpath). Caller
overrides take precedence over everything:
builder().override("information", "informations").
Python baseline: inflect 7.6.0
The most widely used Python pluralization engine, scored on the historical v1 P1 protocol (36,239 primary / 50,938 overall, default modern mode). These baseline numbers are retained as historical evidence and are not current v2 measurements. Full write-up in docs/python-baseline.md.
| System | P1 primary | Errors |
|---|---|---|
| This library (historical v1 run) | 100.000% | 0 (36,239 records) |
| evo-inflector 2.0 (historical v1 run) | 96.473% | 1,278 |
PyPI inflect |
94.169% | 2,113 |
| Repaired rules only | 95.168% | 1,751 |
inflect agrees on the headline irregulars
(German, blouse,
person → people, die → dice) and shares
the passer-by → passer-bies weakness. Its misses
concentrate in initialism casing (UFO → UFOS, 0/1,110
on the initialism slice), classical -us forms, and
mass nouns pluralized — the same structural overall-accuracy story
(67.08% vs 68.83% evo2).