Skip to main content
Myanmar borrows extensively from English, Pali, Sanskrit, and neighboring languages. These loan words often have multiple transliteration spellings — for example, “computer” can be written as ကွန်ပျူတာ or ကွမ်ပျူတာ. The loan word module provides bidirectional lookup between standard and variant forms.

Overview

The module loads transliteration variants from rules/loan_words.yaml and provides:
  • Variant → Standard: Given a non-standard spelling, find the standard form(s)
  • Standard → Variants: Given a standard spelling, find all known variant forms
  • SymSpell integration: Variants are injected as spell check candidates during word validation

Data Coverage

Usage

Basic Lookup

Integration with SpellChecker

Loan word variants are automatically used during spell checking when the SymSpell algorithm generates candidates. If a user types a non-standard variant, the standard form is suggested — and vice versa.
No additional configuration is needed — loan word variant lookup is enabled by default at the word validation level.

YAML Structure

Loan words are organized by source language in rules/loan_words.yaml:

Performance

  • YAML is loaded once and cached via @lru_cache
  • Public API returns frozenset (immutable, safe for concurrent access)
  • Lookup is O(1) dictionary access

See Also