diff options
-rw-r--r-- | src/storage/chewing_key.h | 4 | ||||
-rw-r--r-- | src/storage/pinyin_parser2.cpp | 23 |
2 files changed, 17 insertions, 10 deletions
diff --git a/src/storage/chewing_key.h b/src/storage/chewing_key.h index 5d708e0..b83b5d7 100644 --- a/src/storage/chewing_key.h +++ b/src/storage/chewing_key.h @@ -180,13 +180,13 @@ struct ChewingKey struct ChewingKeyRest { - guint16 m_index; /* the index in pinyin parser table. */ + guint16 m_table_index; /* the index in pinyin parser table. */ guint16 m_raw_begin; /* the begin of the raw input. */ guint16 m_raw_end; /* the end of the raw input. */ ChewingKeyRest() { /* the 0th item in pinyin parser table is reserved for invalid. */ - m_index = 0; + m_table_index = 0; m_raw_begin = 0; m_raw_end = 0; } diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index c7bf71b..4e3cbc2 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -70,21 +70,21 @@ static bool check_chewing_options(guint32 options, const chewing_index_item_t * /* methods for Chewing Keys to access pinyin parser table. */ const char * ChewingKeyRest::get_pinyin_string(){ - if (m_index == 0) + if (m_table_index == 0) return NULL; /* check end boundary. */ - assert(m_index < G_N_ELEMENTS(content_table)); - return content_table[m_index].m_pinyin_str; + assert(m_table_index < G_N_ELEMENTS(content_table)); + return content_table[m_table_index].m_pinyin_str; } const char * ChewingKeyRest::get_chewing_string(){ - if (m_index == 0) + if (m_table_index == 0) return NULL; /* check end boundary. */ - assert(m_index < G_N_ELEMENTS(content_table)); - return content_table[m_index].m_chewing_str; + assert(m_table_index < G_N_ELEMENTS(content_table)); + return content_table[m_table_index].m_chewing_str; } @@ -133,8 +133,8 @@ int FullPinyinParser2::parse_one_key (guint32 options, ChewingKey & key, if (!check_pinyin_options(options, index)) continue; - key_rest.m_index = index->m_table_index; - key = content_table[key_rest.m_index].m_chewing_key; + key_rest.m_table_index = index->m_table_index; + key = content_table[key_rest.m_table_index].m_chewing_key; break; } } @@ -151,3 +151,10 @@ int FullPinyinParser2::parse_one_key (guint32 options, ChewingKey & key, g_free(input); return parsed_len; } + + +int FullPinyinParser2::parse (guint32 options, ChewingKeyVector & keys, + ChewingKeyRestVector & key_rests, + const char *str, int len) const { + assert(FALSE); +} |