Skip to main content
When the spell checker encounters an unknown word, the morphology module decomposes it into roots and affixes to infer likely POS tags and generate better suggestions.

Overview

Myanmar words are often formed by combining roots with suffixes and prefixes. The MorphologyAnalyzer can:
  • Guess POS tags based on word morphology
  • Decompose words into roots and suffixes
  • Identify numeral words
  • Handle ambiguous words with multiple POS possibilities
  • Extract morphological patterns for OOV recovery

MorphologyAnalyzer

The main class for morphological analysis.

Basic POS Guessing

Multi-POS Support

Handle words with multiple possible parts of speech:

Word Analysis

Decompose words into roots and suffixes:

With Dictionary Validation

Validate extracted roots against a dictionary:

Using Cached Analyzer

For better performance on repeated calls:

Numeral Detection

Detect Myanmar numerals (digits and words):

POSGuess Data Structure

Results include detailed reasoning:

WordAnalysis Data Structure

Complete word decomposition:

POS Tag Priority

When multiple suffixes match, tags are prioritized:

Confidence Scoring

Confidence is based on:
  1. Numeral detection: 0.95-0.99 (highest)
  2. Proper noun suffixes: 0.85-0.95
  3. Prefix patterns (e.g., အ → Noun): 0.60-0.75
  4. Suffix length ratio: Longer suffix matches = higher confidence
  5. Tag priority: Tie-breaker for similar confidence

Integration with Stemmer

For performance-critical applications, integrate with the Stemmer:

Configuration

The MorphologyConfig controls confidence values used in OOV recovery and suffix-based POS guessing. Pass it to MorphologyAnalyzer to tune morphological analysis behavior.

Custom Grammar Config Path

Load morphology rules from a custom config directory:

Suffix Categories

The analyzer recognizes these suffix types:

Verb Suffixes

  • ခဲ့ (past tense)
  • နေ (progressive)
  • မည် (future)
  • ပြီ (completion)
  • ရ (potential)

Noun Suffixes

  • များ (plural)
  • ချင်း (comparative)
  • လောက် (approximation)

Particle Suffixes

  • သည် (formal ending)
  • တယ် (colloquial ending)
  • မှာ (location)
  • ကို (object marker)

Adverb Suffixes

  • စွာ (manner)
  • အောင် (result)

Morphological Synthesis

In addition to morphological analysis (decomposition), the library provides morphological synthesis (validation of productive word formation). These modules validate OOV words formed through compounding and reduplication.

ReduplicationEngine

Validates words formed by repeating known dictionary words:
Supported patterns:

CompoundResolver

Validates compound words by splitting into known dictionary morphemes using dynamic programming:
Allowed compound patterns (13 patterns): Each pattern has a morphotactic bonus applied during DP scoring (e.g., N+N: +0.10, ADJ+N: +0.08) that favors linguistically common combinations. The DP algorithm penalizes additional parts beyond 2 via a configurable parts_penalty_multiplier (default: 2.0).

Integration

Both engines are automatically integrated into WordValidator when enabled via config:

Relationship to MorphologyAnalyzer

See Also