batterseapower / pinyin-toolkit

A plugin for the Anki Spaced Repetition System (http://ichi2.net/anki/)
http://batterseapower.github.com/pinyin-toolkit/
39 stars 14 forks source link

Implement More Acurate Tone Generation Rules (From Silias) #172

Open Nick3C opened 14 years ago

Nick3C commented 14 years ago

From Silias:

One thing though .. you probably do want the "tone 6". Sorry it's buried deep inside advanced.txt what this is .. it's a higher-pitched version of the neutral tone (tone 5). The higher-pitched version must be used if the preceding tone is tone 3. Try hao3de5 for an example (Gradint will play this as hao3de6 .. the real hao3de5 sounds bad).

By the way I guess you know about the conversion from 3+3 to 2+3 (e.g. ni3hao3 is played as ni2hao3) .. the full algorithm for this is way more complicated than most people think:

  1. Break the input into segments. Insert an "end segment marker" after: (1) any 2-syllable word that ends in tone 3 (2) the special cases "gei3 ni3", "gei3 wo3", "ni3 xiang3", and "wo3 xiang3" (3) any pausing punctuation character e.g. . , ? ;
  2. Look at the input and find consecutive strings of 3s. Turn 33 into 23, 333 into 323, 3333 into 2323, etc (turn it into 2 if there are an ODD number of 3's after it, i.e. if num3%2==0). I do this working back from the end of the string to the start (it's easier). But when doing this, START AGAIN at any "end segment marker" that you inserted in the above step. So for example "gei3 ni3 hao3 xiao1xi5" becomes "gei3 ni3 | hao3 xiao1xi5" and then "gei2 ni3 hao3 xiao1xi5" (not "gei3 ni2 hao3 xiao1xi5").

[Plus commentary to the effect that the Yali pack should not be useful for words with an isolated third tone (as they are actually half-third tones), another source should be used for these]

sneijder commented 12 years ago

Check this issue for probably the best solution of all ie native speaker pronunciation integration. No more need for trimmed single morpheme generated pronunciation with this idea: https://github.com/batterseapower/pinyin-toolkit/issues/210