summaryrefslogtreecommitdiffstats
path: root/src/storage/pinyin_parser2.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-11-15 14:30:07 +0800
committerPeng Wu <alexepico@gmail.com>2011-11-15 14:30:07 +0800
commit5501ea429dd50330caa9cd6ffbd8236d1663fa6e (patch)
treeb0b56c005af0368240e8bd669ef9a2dfb2a54261 /src/storage/pinyin_parser2.cpp
parentba0fe0bfcd3d37f86fad9e7cdf44c511352eca08 (diff)
downloadlibpinyin-5501ea429dd50330caa9cd6ffbd8236d1663fa6e.tar.gz
libpinyin-5501ea429dd50330caa9cd6ffbd8236d1663fa6e.tar.xz
libpinyin-5501ea429dd50330caa9cd6ffbd8236d1663fa6e.zip
write chewing key rest in progress
Diffstat (limited to 'src/storage/pinyin_parser2.cpp')
-rw-r--r--src/storage/pinyin_parser2.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp
index 6885812..ea180fe 100644
--- a/src/storage/pinyin_parser2.cpp
+++ b/src/storage/pinyin_parser2.cpp
@@ -28,7 +28,7 @@
using namespace pinyin;
-bool check_pinyin_options(guint32 options, pinyin_index_item_t * item) {
+static bool check_pinyin_options(guint32 options, pinyin_index_item_t * item) {
guint32 flags = item->m_flags;
assert (flags & IS_PINYIN);
@@ -50,7 +50,7 @@ bool check_pinyin_options(guint32 options, pinyin_index_item_t * item) {
return true;
}
-bool check_chewing_options(guint32 options, chewing_index_item_t * item) {
+static bool check_chewing_options(guint32 options, chewing_index_item_t * item) {
guint32 flags = item->m_flags;
assert (flags & IS_CHEWING);
@@ -62,3 +62,21 @@ bool check_chewing_options(guint32 options, chewing_index_item_t * item) {
return true;
}
+
+const char * ChewingKeyRest::get_pinyin_string(){
+ if (m_index == 0)
+ return NULL;
+
+ /* check end boundary. */
+ assert(m_index < G_N_ELEMENTS(content_table));
+ return content_table[m_index].m_pinyin_str;
+}
+
+const char * ChewingKeyRest::get_chewing_string(){
+ if (m_index == 0)
+ return NULL;
+
+ /* check end boundary. */
+ assert(m_index < G_N_ELEMENTS(content_table));
+ return content_table[m_index].m_chewing_str;
+}