Why Grammar Checking?
Myanmar text can have:- Correct spelling but wrong particles: “သူ ကို” vs “သူ က”
- Verb-modifier mismatches: Wrong causative or passive markers
- Sentence structure errors: Missing required components
- Pass syllable validation (valid syllables)
- Pass word validation (valid words)
- Fail syntactic rules
How It Works
1
POS Tagging
Text is tagged with part-of-speech labels:
2
Rule Application
Grammar rules check tag sequences:
3
Error Generation
Invalid sequences generate grammar errors:
Grammar Rules
Particle Rules
Subject Particle (က)
Object Particle (ကို)
Location Particles (မှာ, တွင်)
Verb Modifier Rules
Causative Construction
Passive Construction
Sentence Structure Rules
Configuration
Enable Grammar Checking
Grammar Rule Configuration
Grammar checking is configured throughGrammarEngineConfig:
SyntacticRuleChecker:
Built-in Grammar Checkers
The grammar system includes several specialized checkers:YAML Rules Configuration
Grammar rules are defined in YAML files located insrc/myspellchecker/rules/:
Load custom rules via
GrammarRuleConfig:
GrammarRuleConfig does not have a morphotactics_path parameter. The morphotactics.yaml file is loaded internally by the grammar engine.src/myspellchecker/rules/ are used.
Error Types and Severity
Error Response
API Reference
SyntacticRuleChecker
Individual Grammar Checkers
Common Patterns
Filter by Confidence
Grammar-Only Check
Report Grammar Issues
Built-in Rules
POS Sequence Rules
Errors
Warnings
Info
Sentence Boundary Rules
Forbidden Sentence Starts
Forbidden Sentence Ends
Sentence Completion Rules
Architecture
The Grammar Engine coordinates eight specialized checkers throughSyntacticRuleChecker:

Confidence Scoring
Grammar suggestions include confidence scores based on context:
Confidence scores are included in the
GrammarError objects returned by check():
Troubleshooting
Issue: Too many false positives
Cause: POS tagging errors or overly strict rules Solution:Issue: Missing grammar errors
Cause: Grammar checkers not enabled Solution: Enable grammar checking in config:Issue: Slow grammar checking
Cause: Complex rules or many patterns Solution: Raise confidence thresholds to reduce processing via GrammarEngineConfig:Next Steps
- POS Tagging - Underlying tagging system
- Semantic Checking - AI-powered deep checking
- Custom Rules - Create your own rules