From 74a8337065edeea7308269338ec537fb6b5acd05 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 12 Sep 2013 15:04:32 +0800 Subject: rename ChewingParser2 to ChewingSimpleParser2 --- src/pinyin.cpp | 4 ++-- src/storage/pinyin_parser2.cpp | 20 +++++++++++--------- src/storage/pinyin_parser2.h | 8 ++++---- 3 files changed, 17 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 886d14b..4a811e7 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -37,7 +37,7 @@ struct _pinyin_context_t{ pinyin_option_t m_options; FullPinyinParser2 * m_full_pinyin_parser; - ChewingParser2 * m_chewing_parser; + ChewingSimpleParser2 * m_chewing_parser; FacadeChewingTable * m_pinyin_table; FacadePhraseTable2 * m_phrase_table; @@ -178,7 +178,7 @@ pinyin_context_t * pinyin_init(const char * systemdir, const char * userdir){ check_format(context); context->m_full_pinyin_parser = new FullPinyinParser2; - context->m_chewing_parser = new ChewingParser2; + context->m_chewing_parser = new ChewingSimpleParser2; /* load chewing table. */ context->m_pinyin_table = new FacadeChewingTable; diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index f3ec9fa..dc2421e 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -461,9 +461,9 @@ static bool search_chewing_tones(const chewing_tone_item_t * tone_table, } -bool ChewingParser2::parse_one_key(pinyin_option_t options, - ChewingKey & key, - const char *str, int len) const { +bool ChewingSimpleParser2::parse_one_key(pinyin_option_t options, + ChewingKey & key, + const char *str, int len) const { /* options &= ~(PINYIN_CORRECT_ALL|PINYIN_AMB_ALL); */ options &= ~PINYIN_AMB_ALL; char tone = CHEWING_ZERO_TONE; @@ -512,9 +512,10 @@ bool ChewingParser2::parse_one_key(pinyin_option_t options, /* only characters in chewing keyboard scheme are accepted here. */ -int ChewingParser2::parse(pinyin_option_t options, ChewingKeyVector & keys, - ChewingKeyRestVector & key_rests, - const char *str, int len) const { +int ChewingSimpleParser2::parse(pinyin_option_t options, + ChewingKeyVector & keys, + ChewingKeyRestVector & key_rests, + const char *str, int len) const { g_array_set_size(keys, 0); g_array_set_size(key_rests, 0); @@ -555,7 +556,7 @@ int ChewingParser2::parse(pinyin_option_t options, ChewingKeyVector & keys, } -bool ChewingParser2::set_scheme(ChewingScheme scheme) { +bool ChewingSimpleParser2::set_scheme(ChewingScheme scheme) { switch(scheme) { case CHEWING_STANDARD: m_symbol_table = chewing_standard_symbols; @@ -579,8 +580,9 @@ bool ChewingParser2::set_scheme(ChewingScheme scheme) { } -bool ChewingParser2::in_chewing_scheme(pinyin_option_t options, - const char key, const char ** symbol) +bool ChewingSimpleParser2::in_chewing_scheme(pinyin_option_t options, + const char key, + const char ** symbol) const { const gchar * chewing = NULL; char tone = CHEWING_ZERO_TONE; diff --git a/src/storage/pinyin_parser2.h b/src/storage/pinyin_parser2.h index 18a835b..6b530b7 100644 --- a/src/storage/pinyin_parser2.h +++ b/src/storage/pinyin_parser2.h @@ -146,7 +146,7 @@ public: }; /** - * ChewingParser2: + * ChewingSimpleParser2: * * Parse the chewing string into an array of struct ChewingKeys. * @@ -161,7 +161,7 @@ public: /* Note: maybe yunmus shuffle will be supported later. * currently this feature is postponed. */ -class ChewingParser2 : public PhoneticParser2 +class ChewingSimpleParser2 : public PhoneticParser2 { /* Note: some internal pointers to chewing scheme table. */ protected: @@ -169,12 +169,12 @@ protected: const chewing_tone_item_t * m_tone_table; public: - ChewingParser2() { + ChewingSimpleParser2() { m_symbol_table = NULL; m_tone_table = NULL; set_scheme(CHEWING_DEFAULT); } - virtual ~ChewingParser2() {} + virtual ~ChewingSimpleParser2() {} virtual bool parse_one_key(pinyin_option_t options, ChewingKey & key, const char *str, int len) const; -- cgit