Pipeline & Document¶
process(text) and BurmeseNLP.process(text) run the full V1 stack once and
return a Document.
Input is expected to be Unicode Myanmar text. The pipeline runs NFC /
zero-width cleanup via normalize(); it does not call zg2uni. Convert
Zawgyi with zg2uni / to_unicode before process() when needed
(see Normalization & Zawgyi).
Order¶
Verified against BurmeseNLP._analyze():
- Normalize
- Syllable tokenize
- Word tokenize (longest match)
- BMWE merge
- POS tag (MWE-aware)
- Gazetteer NER →
doc.entities(skip withgazetteer=False) - Phrase chunk (entity spans locked as NP)
- Grammar-aware sentence segment
- Clause parse →
doc.sentence_trees/doc.clauses
Document fields¶
| Field | Meaning |
|---|---|
raw_text |
Normalized input |
syllables |
Syllable strings |
words |
Post-MWE word tokens |
sentences |
Sentence strings (partition of raw_text) |
pos_tags |
(word, tag) pairs aligned with words |
sentence_word_tags |
Per-sentence slices of pos_tags |
mwe |
Merged MWEToken spans |
entities |
Gazetteer NER hits (PERSON / TOWN / …) |
chunks |
Phrase Chunk objects |
sentence_trees |
Per-sentence syntax with nested phrases + clauses |
clauses |
Flat list of clauses from sentence_trees |
Serialization¶
doc = process("စာဖတ်သည်။")
payload = doc.to_dict() # plain dict
doc.to_json(ensure_ascii=False) # JSON string
Mapping-style access still works: doc["words"], "chunks" in doc,
"entities" in doc, "clauses" in doc.
For training-oriented formats (JSONL / CoNLL / BRAT / Label Studio), use
CorpusExporter.