summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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