How nghimestudio/vietnormalizer works
vietnormalizer is a Python library for converting Vietnamese text into normalized, speech-friendly text. Its main workflow is a caller passing text to VietnameseNormalizer, which delegates number/date/time and text processing to VietnameseTextProcessor, then applies dictionary replacements and optionally transliterates remaining non-Vietnamese words. Detection and transliteration are also available as direct library functions. README features fill in several conversion stages; sampled excerpts do not establish their individual internal call paths.
Main entry points: processor.py Text processor · normalizer.py Text normalizer · __init__.py Package exports · transliterator.py Rule transliterator
Components 16
Public API
- Package exports
vietnormalizer/__init__.py
Normalization Pipeline
- Text normalizer
vietnormalizer/normalizer.py - Text processor
vietnormalizer/processor.py - Dictionary lookup
vietnormalizer/normalizer.py - Unicode and cleanup
vietnormalizer/processor.py - Number conversion
vietnormalizer/processor.py - Date and time conversion
vietnormalizer/processor.py - Currency and percent
vietnormalizer/processor.py - Measurement conversion
vietnormalizer/processor.py - Phone conversion
vietnormalizer/processor.py - Ordinal conversion
vietnormalizer/processor.py
Language Resources
- Vietnamese detector
vietnormalizer/detector.py - Rule transliterator
vietnormalizer/transliterator.py - Acronym dictionary
vietnormalizer/data/acronyms.csv - Word dictionary
vietnormalizer/data/non-vietnamese-words.csv
Other components
- Library caller
Connections 20
- Library caller → Package exports: imports
- Package exports → Text normalizer: exports
- Package exports → Text processor: exports
- Package exports → Vietnamese detector: exports
- Package exports → Rule transliterator: exports
- Library caller → Text normalizer: normalizes text
- Text normalizer → Text processor: processes text
- Text normalizer → Dictionary lookup: applies replacements
- Text normalizer → Rule transliterator: transliterates leftovers
- Text normalizer → Vietnamese detector: checks words
- Dictionary lookup → Acronym dictionary: loads
- Dictionary lookup → Word dictionary: loads
- Text processor → Unicode and cleanup: cleans text
- Text processor → Number conversion: converts numbers
- Text processor → Date and time conversion: converts dates
- Text processor → Currency and percent: converts amounts
- Text processor → Measurement conversion: converts units
- Text processor → Phone conversion: reads digits
- Text processor → Ordinal conversion: converts ordinals
- Rule transliterator → Vietnamese detector: checks Vietnamese