့, း) change the meaning of words completely. However, these marks are frequently omitted or misused in informal typing.
The Tone Disambiguator module uses context to infer the correct tonal spelling when multiple valid dictionary words share the same base form.
The Problem
Consider the wordသာ:
သာ(Low tone): meaning “merely/pleasant”.သား(High tone): meaning “son”.
ငါ:
ငါ(Low tone): Pronoun “I/Me”.ငါး(High tone): “Five” or “Fish”.
ငါ as correct even in the sentence ငါ ကောင် (intended ငါး ကောင် - five animals), because ငါ is a valid word.
Solution: Context-Aware Disambiguation
mySpellChecker includes a rule-based disambiguator that looks at a 3-word window around ambiguous terms to decide the likely intended meaning.
Usage
The disambiguator is available as a utility:Supported Ambiguity Patterns
The system currently handles several high-frequency ambiguous clusters:Tone Mark Correction
Beyond ambiguous words, the module also detects missing or wrong tone marks for specific high-probability patterns:- Question Particle:
သလာ→သလား(e.g.,စားပြီးပြီသလာ→စားပြီးပြီသလား) - Numbers:
သုံ→သုံး(Three) - Numbers/Wind:
လေ→လေး(Four/wind, context-dependent and only in numeral contexts)
Configuration
The disambiguator is integrated into the mainSpellChecker validation pipeline and configured via ToneConfig:
The default ambiguity patterns and tone mark corrections are hard-coded in the module. To customize them, provide your own mappings via the YAML-based grammar rules system using
tone_rules.yaml.