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: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
4. Group Related Rules
Organize rules by category for maintainability:Debugging Rules
Enable Grammar Debug Logging
Check Rule Matching
See Also
- Grammar Checking - Feature overview
- POS Tagging - Part-of-speech tagging
- Viterbi Algorithm - POS tagger implementation
- Error Types - Error type reference