- Moved global variables (ARPA, _g2p, eng_dict, tokenizer) to top-level scope to avoid redundant initialization. - Simplified conditions for words with apostrophes. - Streamlined __post_replace_ph function by removing redundant checks. - Optimized __refine_syllables function with direct iteration. - Avoided re-initialization of tokenizer in __text_to_words by moving it to global scope. - Added performance test in __main__ to validate improvements. - Resolves issue #104.
4.8 KiB
4.8 KiB