summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-11-23 13:29:22 +0800
committerPeng Wu <alexepico@gmail.com>2015-11-23 13:29:36 +0800
commit6783bac98e70b14f1c58de63a9dcc9fce919d78c (patch)
treedb045580e11b0cb4758cd3228c5039ed99e72f5e
parente19961b71aacaa4136c0a7e603aabcddd09de054 (diff)
downloadlibpinyin-6783bac98e70b14f1c58de63a9dcc9fce919d78c.tar.gz
libpinyin-6783bac98e70b14f1c58de63a9dcc9fce919d78c.tar.xz
libpinyin-6783bac98e70b14f1c58de63a9dcc9fce919d78c.zip
fixes double pinyin parser
-rw-r--r--src/storage/pinyin_parser2.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp
index 98cf04b..8654db5 100644
--- a/src/storage/pinyin_parser2.cpp
+++ b/src/storage/pinyin_parser2.cpp
@@ -649,8 +649,9 @@ bool DoublePinyinParser2::parse_one_key(pinyin_option_t options,
int charid = ch == ';' ? 26 : ch - 'a';
const char * sheng = m_shengmu_table[charid].m_shengmu;
+ gchar * pinyin = NULL;
if (NULL == sheng)
- return false;
+ goto fallback;
if (0 == strcmp(sheng, "'"))
sheng = "";
@@ -659,7 +660,6 @@ bool DoublePinyinParser2::parse_one_key(pinyin_option_t options,
if (!IS_KEY(ch))
return false;
- gchar * pinyin = NULL;
do {
charid = ch == ';' ? 26 : ch - 'a';
@@ -690,6 +690,7 @@ bool DoublePinyinParser2::parse_one_key(pinyin_option_t options,
g_free(pinyin);
} while(0);
+ fallback:
/* support fallback table for double pinyin. */
if (m_fallback_table) {
gchar * input = g_strndup(str, 2);