summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-09-12 15:04:32 +0800
committerPeng Wu <alexepico@gmail.com>2013-09-12 15:04:32 +0800
commit74a8337065edeea7308269338ec537fb6b5acd05 (patch)
treeb3ad1c0116ab901f5dcb2bc087e6aeba88c2889f
parentb4ea781c0f9b845d14ced43eda05ea95be7fef57 (diff)
downloadlibzhuyin-74a8337065edeea7308269338ec537fb6b5acd05.tar.gz
libzhuyin-74a8337065edeea7308269338ec537fb6b5acd05.tar.xz
libzhuyin-74a8337065edeea7308269338ec537fb6b5acd05.zip
rename ChewingParser2 to ChewingSimpleParser2
-rw-r--r--src/pinyin.cpp4
-rw-r--r--src/storage/pinyin_parser2.cpp20
-rw-r--r--src/storage/pinyin_parser2.h8
-rw-r--r--tests/storage/test_parser2.cpp2
4 files changed, 18 insertions, 16 deletions
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;
diff --git a/tests/storage/test_parser2.cpp b/tests/storage/test_parser2.cpp
index af3f939..6657d27 100644
--- a/tests/storage/test_parser2.cpp
+++ b/tests/storage/test_parser2.cpp
@@ -75,7 +75,7 @@ int main(int argc, char * argv[]) {
if (strcmp("fullpinyin", parsername) == 0) {
parser = new FullPinyinParser2();
} else if (strcmp("chewing", parsername) == 0) {
- parser = new ChewingParser2();
+ parser = new ChewingSimpleParser2();
}
if (!parser)