MWE¶
burmesenlp.mwe.BMWEEngine ¶
BMWEEngine(lexicon: Optional[Lexicon] = None, validator: Optional[MWEValidator] = None, *, autoload_idioms: bool = True)
Burmese Multi-Word Expression engine (post-tokenization merge).
Source code in src/burmesenlp/mwe/engine.py
load ¶
load(path: str, *, category: Optional[str] = None, priority: int = 0, allow_unigrams: bool = False, use_cache: bool = True, write_cache_on_miss: bool = True) -> int
Load a JSON/TXT MWE list into the trie. Returns entry count.
Source code in src/burmesenlp/mwe/engine.py
process ¶
process_detailed ¶
Greedy left-to-right MWE merge; return strings + span metadata.
Source code in src/burmesenlp/mwe/engine.py
burmesenlp.mwe.MWEEntry
dataclass
¶
MWEEntry(text: str, tokens: Tuple[str, ...], category: str, priority: int = 0, pos: Optional[str] = None)
A multi-word expression loaded into the trie.
burmesenlp.mwe.MWEToken
dataclass
¶
MWEToken(text: str, tokens: Tuple[str, ...], category: str, start: int, end: int, priority: int = 0, pos: Optional[str] = None, index: Optional[int] = None)
A merged MWE span over a pre-MWE word token sequence.