Skip to main content
Beyond standard SymSpell suggestions, mySpellChecker includes two specialized suggestion strategies that target Myanmar-specific error patterns: morpheme-level correction for compound words, and medial consonant swap generation.

Morpheme Suggestion Strategy

When an OOV word is a near-miss compound (one morpheme has a typo) or near-miss reduplication, this strategy corrects the individual morpheme and reconstructs the valid word.

How It Works

  1. Split the OOV word into morphemes using CompoundResolver
  2. Identify which morpheme is invalid (exactly one must be OOV)
  3. Correct the invalid morpheme using SymSpell
  4. Reconstruct the compound with the corrected morpheme

Example

Usage

The morpheme suggestion strategy is automatically included in the suggestion pipeline when compound resolution is enabled:

Configuration

Medial Swap Strategy

Myanmar’s most common error type is ya-pin/ya-yit confusion (ျ ↔ ြ). SymSpell’s delete-distance model cannot reliably generate medial swaps as edit-distance-1 candidates. This strategy directly generates orthographic variants by swapping, inserting, or deleting Myanmar medial consonants.

Myanmar Medials

Operations

The strategy generates candidates through three operations:
  1. Swap: Replace one medial with another (e.g., ျ → ြ)
  2. Insert: Add a medial where none exists
  3. Delete: Remove an existing medial
All generated candidates are validated against the dictionary before being returned as suggestions.

Medial Swap Pairs

Common swap pairs are defined in rules/medial_swap_pairs.yaml:

Usage

The medial swap strategy is automatically included in the suggestion pipeline:

Direct Usage

Integration

Both strategies are part of the multi-strategy suggestion pipeline:

See Also