From b63d6b48aafaa71be55a73ca3c53bd42c8a79196 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 29 Dec 2011 11:02:46 +0800 Subject: [PATCH] update pinyin.cpp --- libpinyin-0.5.x-head.patch | 107 ++++++++++++++++++++++++++++++++++--- 1 file changed, 101 insertions(+), 6 deletions(-) diff --git a/libpinyin-0.5.x-head.patch b/libpinyin-0.5.x-head.patch index f331d6d..2b71750 100644 --- a/libpinyin-0.5.x-head.patch +++ b/libpinyin-0.5.x-head.patch @@ -1,7 +1,7 @@ From 11dfb3b72c7128e05e8608ff501d06b80a2788c1 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 26 Dec 2011 14:56:09 +0800 -Subject: [PATCH 1/6] fixes pinyin_translate_token +Subject: [PATCH 1/7] fixes pinyin_translate_token --- src/pinyin.cpp | 4 ++-- @@ -32,7 +32,7 @@ index f4a20fe..a3fd37d 100644 From 49869f6917edf488f0daca22e32a8166cf6e0325 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 26 Dec 2011 15:17:46 +0800 -Subject: [PATCH 2/6] increase train factor +Subject: [PATCH 2/7] increase train factor --- src/lookup/pinyin_lookup.cpp | 2 +- @@ -72,7 +72,7 @@ index a3fd37d..5a1b683 100644 From 2fd2eea102bfa32d662dca823bf1cfeed3a94c1c Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 26 Dec 2011 18:34:49 +0800 -Subject: [PATCH 3/6] fixes parallel make +Subject: [PATCH 3/7] fixes parallel make --- data/Makefile.am | 10 ++++++++-- @@ -114,7 +114,7 @@ index 25e4683..6f74f4e 100644 From 13aac5af9c6e3f3a2e243806f102e7477b686c91 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 27 Dec 2011 11:09:06 +0800 -Subject: [PATCH 4/6] fixes data/Makefile.am +Subject: [PATCH 4/7] fixes data/Makefile.am --- data/Makefile.am | 4 +--- @@ -143,7 +143,7 @@ index 6f74f4e..2964bb9 100644 From be97324565a43072744dc73a21ee4a2ae18f786c Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 29 Dec 2011 10:50:21 +0800 -Subject: [PATCH 5/6] update ChangeLog +Subject: [PATCH 5/7] update ChangeLog --- ChangeLog | 14 ++++++++++++-- @@ -175,7 +175,7 @@ index fed9c34..5c0237b 100644 From d3eda7ee46fdab4f4b5bf3cf4e0e2ab1db447b9b Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 29 Dec 2011 10:52:03 +0800 -Subject: [PATCH 6/6] update libpinyin.spec.in +Subject: [PATCH 6/7] update libpinyin.spec.in --- libpinyin.spec.in | 2 +- @@ -197,3 +197,98 @@ index c0d50d9..39f52bc 100644 -- 1.7.7.4 + +From 9f0f08875bfc4125a0b4b8a7a7b31314d7c876d8 Mon Sep 17 00:00:00 2001 +From: Peng Wu +Date: Thu, 29 Dec 2011 11:01:55 +0800 +Subject: [PATCH 7/7] update pinyin.cpp + +--- + src/pinyin.cpp | 22 +++++++++++----------- + 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); + +-- +1.7.7.4 +