Skip to main content
mySpellChecker uses YAML configuration files to define linguistic rules for Myanmar language. These files are located in src/myspellchecker/rules/ and can be customized for specific use cases.

Rule Files Overview

File Structure

All rule files follow a common structure:

Particles (particles.yaml)

Defines Myanmar linguistic particles organized by syntactic function.

Structure

POS Tags

Formality Levels

  • colloquial - Spoken/informal
  • neutral - Both formal and informal
  • formal - Written/formal
  • polite - Respectful register
  • literary - Literary style

Typo Corrections (typo_corrections.yaml)

Defines common Myanmar typo patterns with corrections.

Structure

Error Types

Context Types

  • after_noun - Follows a noun
  • after_verb - Follows a verb
  • context_dependent - Requires context analysis
  • standalone - Independent of context

Morphology (morphology.yaml)

Defines suffix and prefix patterns for POS inference.

Structure

Aspects (aspects.yaml)

Defines verb aspect markers.

Structure

Classifiers (classifiers.yaml)

Defines numeral classifiers for counting.

Structure

Register (register.yaml)

Maps formal and colloquial equivalents.

Structure

Negation (negation.yaml)

Defines negation patterns.

Structure

Homophones (homophones.yaml)

Defines homophone pairs for context checking.

Structure

Context disambiguation is handled automatically via N-gram probabilities at the strategy level, so no per-entry disambiguation context is needed in the YAML.

Compounds (compounds.yaml)

Defines compound word formations.

Structure

Custom Configuration

Loading Custom Rules

Extending Rules

Add custom entries by creating additional YAML files:

Schema Validation

Rule files are validated against JSON schemas in src/myspellchecker/schemas/. There is one schema file per YAML rule file (30 total, including _common.schema.json for shared definitions):
  • _common.schema.json, shared definitions referenced by other schemas
  • ambiguous_words.schema.json
  • aspects.schema.json
  • classifiers.schema.json
  • collocations.schema.json
  • compound_confusion.schema.json
  • compounds.schema.json
  • confusable_pairs.schema.json
  • confusion_matrix.schema.json
  • corruption_weights.schema.json
  • detector_confidences.schema.json
  • grammar_rules.schema.json
  • homophone_confusion.schema.json
  • homophones.schema.json
  • medial_confusion.schema.json
  • medial_swap_pairs.schema.json
  • morphology.schema.json
  • morphotactics.schema.json
  • negation.schema.json
  • orthographic_corrections.schema.json
  • particles.schema.json
  • pos_inference.schema.json
  • pronouns.schema.json
  • register.schema.json
  • rerank_rules.schema.json
  • semantic_rules.schema.json
  • stacking_pairs.schema.json
  • tense_markers.schema.json
  • tone_rules.schema.json
  • typo_corrections.schema.json

Best Practices

  1. Confidence scores: Use 0.9+ for high-certainty rules, 0.7-0.9 for moderate, below 0.7 for context-dependent
  2. Context constraints: Always specify context when rules are position-dependent
  3. Examples: Include examples for documentation and testing
  4. Version control: Update metadata.last_updated when modifying rules
  5. Testing: Test rule changes with representative corpus data

See Also