pinyin_pro_flutter 1.1.0
pinyin_pro_flutter: ^1.1.0 copied to clipboard
A professional Chinese pinyin conversion library for Dart and Flutter. Supports tone marks, multiple readings, text matching, HTML generation, and custom dictionaries.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.1.0 - 2026-11-19 #
Synchronized with upstream pinyin-pro v3.29.5. No breaking changes.
Added #
ToneSandhiOptionswithyi,bu, andthirdToneflags for fine-grained tone sandhi control.- Opt-in consecutive third-tone sandhi:
你好→ní hǎowhenToneSandhiOptions(thirdTone: true)is used. - String replacement support for
MatchOptions.v, e.g.MatchOptions(v: 'u')replacesüwithuwhile matching.
Changed #
toneSandhinow accepts either aboolorToneSandhiOptionsinPinyinOptions,SegmentOptions, andHtmlOptions. A plainboolkeeps the previous behavior.MatchOptions.vnow acceptsboolorStringinstead of onlybool.customPinyinnow batches rebuilds and replaces previous custom patterns instead of accumulating them across repeated updates.- Updated pinyin, segment, match, and dictionary behavior to match upstream pinyin-pro v3.29.5.
Fixed #
getPinyinWithoutTonenow handles syllabicn/mandêwith combining tone marks (n̄,ń,ň,ǹ,m̄,ḿ,m̌,m̀,ê̄,ế,ê̌,ề).- Corrected the dictionary reading of
行长toháng zhǎng. - Added the missing
一丁点儿dictionary entry (yī dīng diǎn er). - Repeated
customPinyinupdates no longer accumulate stale custom patterns.
Performance #
- Added a fast path to
splitStringfor strings without surrogate pairs. - Optimized Aho-Corasick construction and matching with depth tracking, direct child lookup, and deferred custom-dictionary rebuilds.
- Reworked maximum-probability segmentation to use backpointers, reducing allocations during tokenization.
- Reduced per-character pinyin overhead by avoiding redundant string splits, lazily building special-case processors, and reusing character buffers.