SpellCheckerBuilder for convenient construction, or inject dependencies directly via the constructor for advanced use cases.
Class: SpellChecker
Initialization
The recommended way to initializeSpellChecker is via the SpellCheckerBuilder.
SpellChecker(config, segmenter, provider, syllable_validator, word_validator, context_validator, factory) is still available for advanced users who need direct dependency injection but is less convenient. All parameters are optional (defaulting to None).
check()
Performs spell checking on the given text.
The input Myanmar text to check.
Validation depth.
SYLLABLE for fast checks, WORD for full validation including context.Override semantic checking for this call.
None uses config default, True/False forces on/off.Response
segment_and_tag(text: str) -> Tuple[List[str], List[str]]
Segments text into words and assigns Part-of-Speech tags using the configured method (Joint or Sequential).
Returns:
- Tuple of
(words, tags).
check_async()
Asynchronous version of check. Runs the CPU-intensive logic in a thread pool to avoid blocking the event loop.
The input Myanmar text to check.
Validation depth.
Override semantic checking for this call.
Response
Usage Example:
- Web APIs (FastAPI/Sanic): Keeps the server responsive while processing text.
- Concurrent Batching: Processing multiple texts in parallel using
asyncio.gather.
check_batch()
Efficiently checks a list of texts.
List of texts to check.
Validation depth applied to all texts.
list[Response]
Class: Response
The check method returns a Response object.
Original input text.
Text with top suggestions applied automatically.
True if any errors were found.Validation level used (
"syllable" or "word").List of error objects found in the text.
Processing metadata including
processing_time, error counts, and validation statistics.