Skip to content

Commit

Permalink
不要给ü添加数字调号
Browse files Browse the repository at this point in the history
  • Loading branch information
upsuper committed Jun 1, 2019
1 parent f8fc11b commit e8ce1d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build.rs
Expand Up @@ -133,7 +133,9 @@ const STYLES: &[Style] = &[
Some((base, tone)) => {
const TONES: &[char] = &['0', '1', '2', '3', '4'];
result.push(base);
result.push(TONES[usize::try_from(tone).unwrap()]);
if tone > 0 {
result.push(TONES[usize::try_from(tone).unwrap()]);
}
}
None => result.push(ch),
}
Expand Down
2 changes: 1 addition & 1 deletion tests/pinyin/a.txt-with_tone_num
@@ -1,4 +1,4 @@
da4i,ba2o,ho2ng,she1n,-,yue1,lv0e4,lv4,hua2n,yu2n,ni4,-
da4i,ba2o,ho2ng,she1n,-,yue1,lve4,lv4,hua2n,yu2n,ni4,-
xia3o,yua1n,ya1ng,-,ji1n,fe3i,cui4,-,che1ng,re2n,xi1n,-
ji3n,li2n,wu2,chu4,chua2n,yo1u,yi4,-,ha3i,ya4n,la2n,ta2ng,chu1n,yo4u,qu4,-
ge2,nia2n,shu1,-,qia1n,dia3n,le4i,-,he4n,na2n,re4n,-

0 comments on commit e8ce1d3

Please sign in to comment.