summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-07 15:56:49 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-07 15:56:49 +0800
commit4aebb8f84e92da3075da3057afbcce5fa9fed2f7 (patch)
treefa670c1b840370dd01f4d4d746aace1e1d646032 /src
parentdcfbeeaa0e381a7d03cdec05e8712753c2afb1e2 (diff)
downloadlibpinyin-4aebb8f84e92da3075da3057afbcce5fa9fed2f7.tar.gz
libpinyin-4aebb8f84e92da3075da3057afbcce5fa9fed2f7.tar.xz
libpinyin-4aebb8f84e92da3075da3057afbcce5fa9fed2f7.zip
write gen chewing table
Diffstat (limited to 'src')
-rw-r--r--src/storage/chewing_key.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/storage/chewing_key.h b/src/storage/chewing_key.h
index 5bbd6ed..05b6949 100644
--- a/src/storage/chewing_key.h
+++ b/src/storage/chewing_key.h
@@ -193,6 +193,16 @@ struct ChewingKeyRest
const char * get_chewing_string();
};
+static inline gchar * get_pinyin_string(ChewingKey key,
+ ChewingKeyRest key_rest) {
+ if (CHEWING_ZERO_TONE != key.m_tone) {
+ return g_strdup_printf
+ ("%s%d", key_rest.get_pinyin_string(), key.m_tone);
+ } else {
+ return g_strdup(key_rest.get_pinyin_string());
+ }
+}
+
};
#endif