Skip to main content
The built-in grammar rules cover common Myanmar syntactic patterns, but every domain has its own conventions. Formal government documents use different particle patterns than casual chat. You can provide your own YAML rules file to add, override, or disable specific grammar checks without modifying the library.

Overview

The rule engine checks for:
  • Invalid POS sequences (e.g., V-V, P-P patterns)
  • Sentence boundary constraints
  • Particle chain validation
  • Register consistency (formal vs colloquial)
  • Negation and classifier rules

Rule File Location

Default grammar rules are located at:
You can provide custom rules via configuration:

YAML Schema

File Structure

Rule Categories

Sentence Constraints

Define what particles can or cannot appear at sentence boundaries:

Invalid POS Sequences

Define patterns that indicate grammatical errors:

Required Particles

Define when particles are typically required:

Particle Chains

Define valid and invalid particle combinations:

Register Rules

Check for consistency between formal and colloquial style:

Negation Rules

Validate proper negation patterns:

Classifier Rules

Validate numeral-classifier-noun patterns:

Tag Definitions

Particle Tags

Map specific words to POS tags for validation:

Interjection Tags

Severity Levels

Confidence Scores

Confidence ranges from 0.0 to 1.0:

Creating Custom Rules

1

Create YAML File

2

Load Custom Rules

3

Test Rules

Best Practices

1. Use Examples

Always include examples in rules:

2. Include Exceptions

List valid exceptions to patterns:

3. Set Appropriate Confidence

  • High confidence (0.9+) for clear errors
  • Medium confidence (0.6-0.8) for likely errors
  • Low confidence (<0.5) for informational patterns
Organize rules by category for maintainability:

Debugging Rules

Enable Grammar Debug Logging

Check Rule Matching

See Also