summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/storage/chewing_key.h2
-rw-r--r--src/storage/pinyin_parser2.cpp14
2 files changed, 16 insertions, 0 deletions
diff --git a/src/storage/chewing_key.h b/src/storage/chewing_key.h
index 721f566..c853eb0 100644
--- a/src/storage/chewing_key.h
+++ b/src/storage/chewing_key.h
@@ -92,6 +92,8 @@ public:
/* Note: the return value should be freed by g_free. */
gchar * get_pinyin_string();
+ gchar * get_shengmu_string();
+ gchar * get_yunmu_string();
gchar * get_chewing_string();
};
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp
index 131231c..f4ea2dd 100644
--- a/src/storage/pinyin_parser2.cpp
+++ b/src/storage/pinyin_parser2.cpp
@@ -94,6 +94,20 @@ gchar * ChewingKey::get_pinyin_string() {
}
}
+gchar * ChewingKey::get_shengmu_string() {
+ gint index = get_table_index();
+ assert(index < G_N_ELEMENTS(content_table));
+ const content_table_item_t & item = content_table[index];
+ return g_strdup(item.m_shengmu_str);
+}
+
+gchar * ChewingKey::get_yunmu_string() {
+ gint index = get_table_index();
+ assert(index < G_N_ELEMENTS(content_table));
+ const content_table_item_t & item = content_table[index];
+ return g_strdup(item.m_yunmu_str);
+}
+
gchar * ChewingKey::get_chewing_string() {
assert(m_tone < CHEWING_NUMBER_OF_TONES);
gint index = get_table_index();