diff options
author | Peng Wu <alexepico@gmail.com> | 2011-11-22 10:54:35 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-12-22 12:23:15 +0800 |
commit | 092b927577798f6e4742c6a0d8e98fcd4d30adea (patch) | |
tree | 948a4421c90e50584563cfe7df4558202317dd1a | |
parent | 0fb453ad10c68a4a4462c1e163afd5825696d9d3 (diff) | |
download | ibus-libpinyin-092b927577798f6e4742c6a0d8e98fcd4d30adea.tar.gz |
fixes pinyin yunmu 'v' handle
-rw-r--r-- | src/PYPFullPinyinEditor.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/PYPFullPinyinEditor.cc b/src/PYPFullPinyinEditor.cc index 07073b6..9c019e3 100644 --- a/src/PYPFullPinyinEditor.cc +++ b/src/PYPFullPinyinEditor.cc @@ -94,7 +94,18 @@ LibPinyinFullPinyinEditor::updatePinyin (void) for ( ; iter != pinyins.end (); ++iter ) { PinyinSegment py = *iter; String pinyin = py.pinyin->sheng; - pinyin += py.pinyin->yun; + gunichar yun_v = g_utf8_get_char("ΓΌ"); + gchar buf[7]; + for (const gchar * p = py.pinyin->yun; *p; p = g_utf8_next_char (p)){ + gunichar cur_yun = g_utf8_get_char (p); + if (G_UNLIKELY(yun_v == cur_yun)) { + pinyin += "v"; + } else { + gint len = g_unichar_to_utf8 (cur_yun, buf); + buf[len] = '\0'; + pinyin += buf; + } + } pinyin_parse_full_pinyin (m_instance, (const char *)pinyin, &key); pos.set_pos (py.begin); pos.set_length (py.len); g_array_append_val (m_instance->m_pinyin_keys, key); |