LipSpell: A Language-Independent Phonetic Scoring Framework for Spelling Correction Combining Distinctive-Feature Edit Distance, Keyboard Geometry, and Corpus Frequency
Organizations: Department of Computer Science, Universidade Federal de São João del-Rei (UFSJ), São João del-Rei, MG, Brazil
Abstract
Automatic spelling correction must handle both keyboard typographical slips and cognitive or phonetic misspellings where writers approximate a word's pronunciation. Conventional spell checkers rely either on orthographic edit distance and keyboard proximity--which struggle when phonetic errors diverge by multiple characters--or on English-centric phonetic hashes such as Soundex and Metaphone. We present LipSpell, a unified, language-independent phonetic scoring engine paired with swappable language-specific G2P frontends, keyboard maps, and lexicons integrating: (1) a precomputed |P|x|P| phone-distance matrix from universal IPA distinctive features, (2) physical keyboard geometry, and (3) corpus unigram frequency priors, accelerated by a two-stage symmetric-delete and seven-class phonetic-code index. Across six English benchmarks (including 1,000 L2 errors from TOEFL-Spell), LipSpell outperforms Norvig and Hunspell on every dataset and beats Aspell on Norvig1 (78.52% vs. 75.56%), Holbrook (32.00% vs. 26.67%), and TOEFL-Spell (77.30% vs. 72.80%). Evaluated across six languages spanning five branches (Germanic, Romance, Slavic, Semitic, Turkic), three families (Indo-European, Afro-Asiatic, Turkic), and three scripts, LipSpell achieves strong fixed-weight transfer on Brazilian Portuguese (73.00% Top-1 on n=500 Wikipedia without NFD tolerance and 75.80% with NFD vs. 66.40% Norvig, 64.20% Hunspell, 64.00% Aspell) and Russian Cyrillic (85.67% vs. 78.50% Norvig). On 50/50 clean non-word splits with lexicon cleaning and weak-character indels, tuning yields strong gains over Norvig in Portuguese (86.97% vs. 76.75%), Turkish (81.67% vs. 79.05%), Hebrew Abjad (74.59% vs. 62.30%), and French (74.53% vs. 67.92%), while fixed weights remain optimal for English (80.37%) and Russian (85.67%).
Figures & tables
| Phonological Group | Features | Weight |
|---|---|---|
| Major class | syll | |
| cons | ||
| son | ||
| Manner | cont , nas | |
| approx | ||
| delrel , strid , lat |
| Category | Pattern / Rule | IPA Output | Examples |
|---|---|---|---|
| Consonant digraphs | ch //, lh //, nh /J/, rr /h/, ss /s/ | /, , J, h, s/ | chave, milho, banho, carro |
| Velar digraphs | qu /k/, gu /g/ (unconditional; omits /kw, gw/) | /k, g/ | queijo, guerra |
| Diphthongs (oralized) | ~ao /a/, ~oe /o/, ~ae /a/, ou /o/, ei /e/, ai /a/, oi //, au /a/ | /a, o, a, o, e, a, , a/ | coração, põe, mãe, ouro |
| Contextual rules | sc/xc + e,i /s/; c + e,i /s/; g + e,i //; V_s_V /z/; #r /h/ | /s, , z, h/ | nascer, cedo, gelo, casa, rato |
| Vowels & consonants | á/à /a/, ^a/~a //, é //, ^e /e/, ó //, ^o/~o /o/, ç /s/, j //, x //, h | /a, , , e, , o, s, , / | café, avô, caça, hora |
| Code | Phonological Class | Feature Criterion ( ) | Representative IPA Segments |
|---|---|---|---|
| V | Syllabic / Vowel | syll | /a, e, , i, , o, , u, , / |
| N | Nasal | nas | /m, n, N, J/ |
| L | Liquid / Approximant | approx or lat | /l, , , , j, w/ |
| S | Sibilant / Affricate | strid | /s, z, , , , / |
| P | Labial | lab or labdent | /p, b, f, v/ |
| T | Coronal | cor | /t, d, , ð/ |
| Language | (words) | Build (s) | Delete Keys | Phonetic Keys | Peak RSS (MiB) |
|---|---|---|---|---|---|
| French | 74,544 | 3.55 | 3.18M | 195k | 783.2 |
| English | 78,393 | 3.04 | 2.37M | 180k | 497.4 |
| Portuguese | 240,040 | 11.90 | 8.82M | 510k | 1,836.6 |
| Hebrew | 339,791 | 9.12 | 3.04M | 161k | 971.7 |
| Russian | 358,624 | 18.46 | 13.92M | 1.27M | 3,456.4 |
| Turkish | 777,340 | 51.58 | 39.44M | 2.14M | 8,650.6 |
| Dataset | Salience- | Cosine | |
|---|---|---|---|
| Norvig1 ( ) | 36.67 / 55.93 77.41 / 91.85 | 35.93 / 57.04 77.04 / 92.22 | 37.78 / 58.15 78.52 / 92.59 |
| Norvig2 ( ) | 33.50 / 62.25 75.25 / 88.25 | 31.25 / 61.00 74.75 / 88.25 | 36.50 / 65.50 74.75 / 88.75 |
| Aspell ( ) | 24.22 / 43.99 56.98 / 75.58 | 24.42 / 44.19 57.17 / 75.58 | 26.16 / 46.32 56.40 / 75.78 |
| Wikipedia ( ) | 37.67 / 60.00 81.67 / 91.33 | 37.67 / 62.00 81.33 / 91.33 | 40.67 / 63.33 81.67 / 91.33 |
| Holbrook ( ) | 11.33 / 23.00 30.00 / 45.33 | 11.00 / 22.67 30.67 / 45.67 | 13.00 / 25.33 32.00 / 46.67 |
| Metric | Norvig1 | Norvig2 | Aspell | Wiki-EN | Holbrook | TOEFL | PT-Wiki |
|---|---|---|---|---|---|---|---|
| SymDelete only (%) | 96.67 | 89.25 | 79.46 | 93.33 | 57.00 | 93.40 | 86.80 |
| Phonetic code only (%) | 71.48 | 69.75 | 62.40 | 73.00 | 56.33 | 61.30 | 89.20 |
| Combined recall (%) | 98.52 | 95.00 | 88.57 | 94.67 | 78.33 | 94.90 | 96.40 |
| Avg. candidates / query | 262.9 | 219.0 | 235.5 | 204.5 | 398.3 | 239.8 | 280.5 |
| Configuration | Norvig1 | Aspell | Holbrook | TOEFL | PT-Wiki |
|---|---|---|---|---|---|
| A : Orth + Freq | 71.11 / 89.26 | 52.71 / 72.67 | 26.67 / 42.33 | 76.10 / 91.00 | 61.00 / 81.40 |
| B : Orth + Kb + Freq | 74.81 / 91.48 | 53.49 / 74.42 | 27.00 / 44.33 | 76.80 / 91.50 | 68.40 / 83.00 |
| C : Orth + Phon + Freq | 75.56 / 92.59 | 56.01 / 75.39 | 31.00 / 45.00 | 76.10 / 91.00 | 73.80 / 85.00 |
| D : Orth + Kb + Phon | 73.33 / 90.00 | 52.52 / 73.84 | 25.33 / 41.33 | 69.30 / 87.60 | 76.20 / 84.80 |
| E : Full LipSpell | 78.52 / 92.59 | 56.40 / 75.78 | 32.00 / 46.67 | 77.30 / 91.10 | 76.20 / 85.20 |
| Dataset | Norvig ( ) | LipSpell ( ) | Norvig ( ) | LipSpell ( ) | Gain ( ) | ||
|---|---|---|---|---|---|---|---|
| Norvig1 | 204 | 82.35 | 82.84 | 66 | 53.03 | 65.15 | pp |
| Norvig2 | 310 | 79.68 | 82.26 | 90 | 43.33 | 48.89 | pp |
| Aspell | 279 | 72.76 | 73.84 | 237 | 29.11 | 35.86 | pp |
| Wikipedia | 251 | 84.06 | 86.45 | 49 | 46.94 | 57.14 | pp |
| Holbrook | 163 | 44.79 | 47.85 | 137 | 7.30 | 13.14 | pp |
| TOEFL-Spell | 788 | 87.31 | 86.55 | 212 | 39.15 | 42.92 | pp |
| Error Category | Share (%) | Norvig (%) | LipSpell (%) | Gain (pp) | |
|---|---|---|---|---|---|
| Diacritic-only ( ) | 628 | 54.66 | 67.04 | 78.34 | |
| Substitution ( ) | 222 | 19.32 | 81.08 | 82.43 | |
| Ins./Del./Transp. ( ) | 136 | 11.84 | 85.29 | 84.56 | |
| Multi-edit ( ) | 163 | 14.19 | 26.99 | 42.33 |
| Dataset | Vocab ( O/A/H %) | Aspell | Hunspell | Norvig | LipSpell |
|---|---|---|---|---|---|
| Norvig1 ( ) | 98.5 / 98.5 / 99.3 | 75.56 / 92.59 | 64.44 / 84.07 | 75.19 / 91.11 | 78.52 / 92.59 |
| Norvig2 ( ) | 97.0 / 95.5 / 96.0 | 77.25 / 87.00 | 65.50 / 84.00 | 71.50 / 87.50 | 74.75 / 88.50 |
| Aspell ( ) | 99.0 / 97.7 / 98.1 | 58.72 / 80.81 | 53.49 / 73.64 | 52.71 / 71.12 | 56.40 / 75.78 |
| Wikipedia ( ) | 97.3 / 70.3 / 71.7 | 83.33 / 91.00 | 55.33 / 70.00 | 78.00 / 90.33 | 81.67 / 91.33 |
| Holbrook ( ) | 97.0 / 86.3 / 86.3 | 26.67 / 42.33 | 17.33 / 31.67 | 27.67 / 41.67 | 32.00 / 46.67 |
| TOEFL-Spell ( ) | 98.7 / 97.5 / 97.8 | 72.80 / 90.40 | 66.90 / 86.90 | 77.10 / 90.40 | 77.30 / 91.10 |
| System | Coverage ( / ) | Top-1 ( ) | Top-5 ( ) | Top-1 ( ) | Top-5 ( ) |
|---|---|---|---|---|---|
| Aspell ( pt_BR ) | 98.4% / 97.4% | 64.00% | 76.80% | 60.14% | 72.93% |
| Hunspell ( pt_BR ) | 98.4% / 97.4% | 64.20% | 79.00% | 63.19% | 76.33% |
| Norvig | 96.8% / 95.8% | 66.40% | 83.00% | 66.23% | 81.29% |
| Phonetic-only | 96.8% / 95.8% | 39.20% | 68.20% | 39.16% | 68.67% |
| LipSpell (direct transfer) | 96.8% / 95.8% | 73.20% | 85.20% | 72.24% | 83.72% |
| LipSpell (NFD) | 96.8% / 95.8% | 76.20% | 85.20% | 74.93% | 83.90% |
| Component | English | Portuguese | Russian | Hebrew | Turkish | French |
|---|---|---|---|---|---|---|
| Rule-based G2P | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Phonological / orthographic rules | ✓ | ✓ | ✓ | — | — | ✓ |
| Weak-character indel overrides | — | — | — | ✓ | — | — |
| Pronunciation dictionary | CMUdict | — | — | — | — | ipa-dict |
| Language (Family / Script) | Aspell | Hunspell | Norvig | LipSpell (Fixed) | LipSpell (Tuned) | ||
|---|---|---|---|---|---|---|---|
| English (Germanic / Latin) | 489 | 77.51 / 92.43 | 69.94 / 89.37 | 79.14 / 92.02 | 80.37 / 92.64 | 79.75 / 92.84 | |
| Russian (Slavic / Cyrillic) | 321 | 71.96 / 88.16 | 67.60 / 87.85 | 78.50 / 90.34 | 85.67 / 95.95 | 84.42 / 95.64 | |
| Hebrew (Semitic / Abjad) | 122 | 39.34 / 84.43 | 33.61 / 91.80 | 62.30 / 95.08 | 63.93 / 95.90 | 74.59 / 98.36 | |
| Portuguese (Romance / Latin) | 499 | 67.13 / 79.96 | 70.14 / 84.77 | 76.75 / 92.59 | 86.77 / 96.19 | 87.17 / 96.79 | |
| Turkish (Turkic / Latin) | 420 | 26.67 / 33.10 | 47.14 / 61.43 | 79.05 / 95.00 | 79.29 / 95.24 | 81.67 / 95.95 | |
| French (Romance / Latin) | 106 | 62.26 / 67.92 | 82.08 / 94.34 | 67.92 / 91.51 | 68.87 / 86.79 | 74.53 / 90.57 |
| Language | Aspell Cov (%) | Hunspell Cov (%) | Dev Top-1 (Fix / Tun) | Best Test Top-1 (95% CI) | |
|---|---|---|---|---|---|
| English | 489 / 489 | 98.77 | 98.77 | 77.71 / 79.55 | 80.37 [76.62, 83.65] |
| Russian | 320 / 321 | 98.75 | 99.07 | 85.62 / 85.62 | 85.67 [81.41, 89.08] |
| Hebrew | 121 / 122 | 93.44 | 100.00 | 70.25 / 79.34 | 74.59 [66.20, 81.48] |
| Portuguese | 498 / 499 | 99.40 | 99.40 | 85.94 / 88.96 | 87.17 [83.95, 89.83] |
| Turkish | 420 / 420 | 32.14 | 89.76 | 75.48 / 78.10 | 81.67 [77.69, 85.08] |
| French | 106 / 106 | 76.42 | 95.28 | 68.87 / 76.42 | 74.53 [65.48, 81.87] |
| Language | Dictionary | Rule-only Fixed | Dict+Rule Fixed | Rule-only Tuned | Dict+Rule Tuned | |
|---|---|---|---|---|---|---|
| English | 489 | CMUdict ( 0.7b ) | 79.35 / 93.25 | 80.37 / 92.64 | 79.96 / 93.46 | 79.75 / 92.84 |
| English | 489 | ipa-dict (126k) | 79.35 / 93.25 | 79.96 / 92.02 | 79.96 / 93.46 | 79.75 / 92.02 |
| Russian | 321 | WikiPron (467k) | 85.67 / 95.95 | 83.80 / 95.02 | 84.42 / 95.64 | 83.80 / 95.02 |
| Hebrew | 122 | WikiPron (6.8k) | 63.93 / 95.90 | 63.93 / 95.08 | 74.59 / 98.36 | 74.59 / 98.36 |
| Portuguese | 499 | ipa-dict (96k) | 86.77 / 96.19 | 85.77 / 95.39 | 87.17 / 96.79 | 85.37 / 95.99 |
| Turkish | 420 | WikiPron (12.3k) | 79.29 / 95.24 | 79.29 / 95.24 | 81.67 / 95.95 | 81.67 / 95.95 |
| Language | Input | Target | Norvig Top-1 | LipSpell Top-1 | Primary Mechanism |
| English | proplen | problem | people | problem | Place/voicing (/p/ /b/, /n/ /m/) |
| English | semetary | cemetery | secretary | cemetery | Contextual sibilant ( c+e /s/) |
| English | splened | splendid | opened | splendid | Tense/lax vowel (// //) |
| English | awfall | awful | wall | awful | Vowel/liquid alignment ( ) |
| Portuguese | albun | álbum | algum | álbum | Nasal /n/ /m/ + NFD tolerance |
| Portuguese | aterisagem | aterrissagem | aterragem | aterrissagem | Digraph equivalence ( rr, ss ) |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Group | Rules (in evaluation order) |
|---|---|
| Suffixes & clusters | tion /n/, sion /n/, ough /o/, augh //, eigh /e/, igh /a/, tch //, dge //, sch /sk/ |
| Consonant digraphs | qu /kw/, ph /f/, sh //, ch //, th //, wh /w/, ng /N/, ck /k/, dg //, gh , kn /n/, gn /n/, wr //, ps /s/ |
| Vowel digraphs | ee /i/, ea /i/, oo /u/, ou /a/, ow /o/, oi //, oy //, ai /e/, ay /e/, ei /e/, ey /e/, au //, aw // |
| R-colored vowels | ar //, er //, ir //, or //, ur // |