From d963dc50f1d00f9d70bbe4ed51ad65329da22542 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 21 Feb 2013 11:23:21 +0800 Subject: add get_shengmu/yunmu_string --- src/storage/chewing_key.h | 2 ++ src/storage/pinyin_parser2.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+) 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(); -- cgit