From b76daca576451fd62ee7903d373690a44a8eb803 Mon Sep 17 00:00:00 2001 From: mozillazg Date: Sun, 12 Dec 2021 09:05:57 +0800 Subject: [PATCH] use pinyin-data v0.12.0 --- CHANGELOG.md | 5 +++++ pinyin-data | 2 +- src/pinyin_multi.rs | 6 +++--- tests/pinyin/b.txt-plain | 2 +- tests/pinyin/b.txt-with_tone | 2 +- tests/pinyin/b.txt-with_tone_num | 2 +- tests/pinyin/b.txt-with_tone_num_end | 2 +- tests/special_pinyin.rs | 4 ++-- 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7383e89..c8d7021 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [0.9.0] (2021-12-11) + +* 使用 [pinyin-data] v0.12.0 的拼音数据 + ## [0.8.0] (2020-06-13) @@ -124,3 +128,4 @@ [0.6.0]: https://github.com/mozillazg/rust-pinyin/compare/v0.5.0...v0.6.0 [0.7.0]: https://github.com/mozillazg/rust-pinyin/compare/v0.6.0...v0.7.0 [0.8.0]: https://github.com/mozillazg/rust-pinyin/compare/v0.7.0...v0.8.0 +[0.9.0]: https://github.com/mozillazg/rust-pinyin/compare/v0.8.0...v0.9.0 diff --git a/pinyin-data b/pinyin-data index 7f9278b..57cc2bd 160000 --- a/pinyin-data +++ b/pinyin-data @@ -1 +1 @@ -Subproject commit 7f9278b53b3f81e5fe5f852e6045f391973bcbd3 +Subproject commit 57cc2bdd0709b42867c861168df73e73953ba92b diff --git a/src/pinyin_multi.rs b/src/pinyin_multi.rs index 0351f6e..78169f6 100644 --- a/src/pinyin_multi.rs +++ b/src/pinyin_multi.rs @@ -77,8 +77,8 @@ pub trait ToPinyinMulti { /// let mut iter = '还'.to_pinyin_multi().unwrap().into_iter(); /// let mut next_pinyin = || iter.next().map(Pinyin::with_tone); /// assert_eq!(next_pinyin(), Some("hái")); -/// assert_eq!(next_pinyin(), Some("fú")); /// assert_eq!(next_pinyin(), Some("huán")); +/// assert_eq!(next_pinyin(), Some("fú")); /// assert_eq!(next_pinyin(), None); /// # } /// ``` @@ -110,7 +110,7 @@ impl ToPinyinMulti for char { /// .and_then(|m| m) /// .map(|m| m.into_iter().map(Pinyin::with_tone).collect::>()) /// }; -/// assert_eq!(next_heteronym(), Some(vec!["hái", "fú", "huán"])); +/// assert_eq!(next_heteronym(), Some(vec!["hái", "huán", "fú"])); /// assert_eq!(next_heteronym(), Some(vec!["méi", "mò", "me"])); /// assert_eq!(next_heteronym(), None); /// # } @@ -194,7 +194,7 @@ mod tests { .collect::>() }) .collect::>(); - let expected = vec![vec!["hái", "fú", "huán"], vec!["méi", "mò", "me"]]; + let expected = vec![vec!["hái", "huán", "fú"], vec!["méi", "mò", "me"]]; assert_eq!(actual, expected); } } diff --git a/tests/pinyin/b.txt-plain b/tests/pinyin/b.txt-plain index 15d9759..980a795 100644 --- a/tests/pinyin/b.txt-plain +++ b/tests/pinyin/b.txt-plain @@ -33,4 +33,4 @@ chu,men,kan,huo,ban,-,huo,ban,jie,jing,huang,- -,tong,xing,shi,er,nian,-,bu,zhi,mu,lan,shi,nü,lang,-,- xiong,tu,jiao,pu,shuo,-,ci,tu,yan,mi,li,- -liang,tu,bang,de,zou,-,an,neng,bian,wo,shi,xiong,ci,- +liang,tu,bang,di,zou,-,an,neng,bian,wo,shi,xiong,ci,- diff --git a/tests/pinyin/b.txt-with_tone b/tests/pinyin/b.txt-with_tone index 948c8cf..2542a72 100644 --- a/tests/pinyin/b.txt-with_tone +++ b/tests/pinyin/b.txt-with_tone @@ -33,4 +33,4 @@ chū,mén,kàn,huǒ,bàn,-,huǒ,bàn,jiē,jīng,huáng,- -,tóng,xíng,shí,èr,nián,-,bù,zhī,mù,lán,shì,nǚ,láng,-,- xióng,tù,jiǎo,pū,shuò,-,cí,tù,yǎn,mí,lí,- -liǎng,tù,bàng,de,zǒu,-,ān,néng,biàn,wǒ,shì,xióng,cí,- +liǎng,tù,bàng,dì,zǒu,-,ān,néng,biàn,wǒ,shì,xióng,cí,- diff --git a/tests/pinyin/b.txt-with_tone_num b/tests/pinyin/b.txt-with_tone_num index 7fcbfef..1d62f4e 100644 --- a/tests/pinyin/b.txt-with_tone_num +++ b/tests/pinyin/b.txt-with_tone_num @@ -33,4 +33,4 @@ chu1,me2n,ka4n,huo3,ba4n,-,huo3,ba4n,jie1,ji1ng,hua2ng,- -,to2ng,xi2ng,shi2,e4r,nia2n,-,bu4,zhi1,mu4,la2n,shi4,nü3,la2ng,-,- xio2ng,tu4,jia3o,pu1,shuo4,-,ci2,tu4,ya3n,mi2,li2,- -lia3ng,tu4,ba4ng,de,zo3u,-,a1n,ne2ng,bia4n,wo3,shi4,xio2ng,ci2,- +lia3ng,tu4,ba4ng,di4,zo3u,-,a1n,ne2ng,bia4n,wo3,shi4,xio2ng,ci2,- diff --git a/tests/pinyin/b.txt-with_tone_num_end b/tests/pinyin/b.txt-with_tone_num_end index 044f94e..0362ad2 100644 --- a/tests/pinyin/b.txt-with_tone_num_end +++ b/tests/pinyin/b.txt-with_tone_num_end @@ -33,4 +33,4 @@ chu1,men2,kan4,huo3,ban4,-,huo3,ban4,jie1,jing1,huang2,- -,tong2,xing2,shi2,er4,nian2,-,bu4,zhi1,mu4,lan2,shi4,nü3,lang2,-,- xiong2,tu4,jiao3,pu1,shuo4,-,ci2,tu4,yan3,mi2,li2,- -liang3,tu4,bang4,de,zou3,-,an1,neng2,bian4,wo3,shi4,xiong2,ci2,- +liang3,tu4,bang4,di4,zou3,-,an1,neng2,bian4,wo3,shi4,xiong2,ci2,- diff --git a/tests/special_pinyin.rs b/tests/special_pinyin.rs index 771f119..2bfe803 100644 --- a/tests/special_pinyin.rs +++ b/tests/special_pinyin.rs @@ -4,10 +4,10 @@ use pinyin::ToPinyinMulti; fn special_pinyin() { assert_eq!( list_all_heteronym('欸'), - &["ai1", "ai3", "xie4", "ê2", "ei2", "ê3", "ei3", "ê4", "ei4", "ê1", "ei1"], + &["ai1", "ai3", "ê1", "ê2", "ê3", "ê4", "xie4", "ei2", "ei3", "ei4", "ei1"], ); assert_eq!(list_all_heteronym('嘸'), &["fu3", "wu3", "m1", "m2"]); - assert_eq!(list_all_heteronym('呣'), &["m2", "mou2", "m4"]); + assert_eq!(list_all_heteronym('呣'), &["m2", "m4", "mou2"]); } fn list_all_heteronym(ch: char) -> Vec<&'static str> {