summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-29 11:01:55 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-29 11:01:55 +0800
commit9f0f08875bfc4125a0b4b8a7a7b31314d7c876d8 (patch)
treea050e574b829ce4581faf8ca6409c29f42a1bf8e
parentd3eda7ee46fdab4f4b5bf3cf4e0e2ab1db447b9b (diff)
downloadlibpinyin-9f0f08875bfc4125a0b4b8a7a7b31314d7c876d8.zip
libpinyin-9f0f08875bfc4125a0b4b8a7a7b31314d7c876d8.tar.gz
libpinyin-9f0f08875bfc4125a0b4b8a7a7b31314d7c876d8.tar.xz
update pinyin.cpp
-rw-r--r--src/pinyin.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 5a1b683..3663904 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -29,8 +29,8 @@
struct _pinyin_context_t{
pinyin_option_t m_options;
- FullPinyinParser2 * m_default_parser;
- DoublePinyinParser2 * m_shuang_pin_parser;
+ FullPinyinParser2 * m_full_pinyin_parser;
+ DoublePinyinParser2 * m_double_pinyin_parser;
ChewingParser2 * m_chewing_parser;
ChewingLargeTable * m_pinyin_table;
@@ -117,8 +117,8 @@ pinyin_context_t * pinyin_init(const char * systemdir, const char * userdir){
g_free(filename);
context->m_pinyin_table->load(chunk);
- context->m_default_parser = new FullPinyinParser2;
- context->m_shuang_pin_parser = new DoublePinyinParser2;
+ context->m_full_pinyin_parser = new FullPinyinParser2;
+ context->m_double_pinyin_parser = new DoublePinyinParser2;
context->m_chewing_parser = new ChewingParser2;
context->m_phrase_table = new PhraseLargeTable;
@@ -226,7 +226,7 @@ bool pinyin_save(pinyin_context_t * context){
bool pinyin_set_double_pinyin_scheme(pinyin_context_t * context,
DoublePinyinScheme scheme){
- context->m_shuang_pin_parser->set_scheme(scheme);
+ context->m_double_pinyin_parser->set_scheme(scheme);
return true;
}
@@ -238,8 +238,8 @@ bool pinyin_set_chewing_scheme(pinyin_context_t * context,
void pinyin_fini(pinyin_context_t * context){
- delete context->m_default_parser;
- delete context->m_shuang_pin_parser;
+ delete context->m_full_pinyin_parser;
+ delete context->m_double_pinyin_parser;
delete context->m_chewing_parser;
delete context->m_pinyin_table;
delete context->m_phrase_table;
@@ -358,7 +358,7 @@ bool pinyin_parse_full_pinyin(pinyin_instance_t * instance,
pinyin_context_t * & context = instance->m_context;
int pinyin_len = strlen(onepinyin);
- int parse_len = context->m_default_parser->parse_one_key
+ int parse_len = context->m_full_pinyin_parser->parse_one_key
( context->m_options, *onekey, onepinyin, pinyin_len);
return pinyin_len == parse_len;
}
@@ -368,7 +368,7 @@ size_t pinyin_parse_more_full_pinyins(pinyin_instance_t * instance,
pinyin_context_t * & context = instance->m_context;
int pinyin_len = strlen(pinyins);
- int parse_len = context->m_default_parser->parse
+ int parse_len = context->m_full_pinyin_parser->parse
( context->m_options, instance->m_pinyin_keys,
instance->m_pinyin_key_rests, pinyins, pinyin_len);
@@ -381,7 +381,7 @@ bool pinyin_parse_double_pinyin(pinyin_instance_t * instance,
pinyin_context_t * & context = instance->m_context;
int pinyin_len = strlen(onepinyin);
- int parse_len = context->m_shuang_pin_parser->parse_one_key
+ int parse_len = context->m_double_pinyin_parser->parse_one_key
( context->m_options, *onekey, onepinyin, pinyin_len);
return pinyin_len == parse_len;
}
@@ -391,7 +391,7 @@ size_t pinyin_parse_more_double_pinyins(pinyin_instance_t * instance,
pinyin_context_t * & context = instance->m_context;
int pinyin_len = strlen(pinyins);
- int parse_len = context->m_shuang_pin_parser->parse
+ int parse_len = context->m_double_pinyin_parser->parse
( context->m_options, instance->m_pinyin_keys,
instance->m_pinyin_key_rests, pinyins, pinyin_len);