improves full pinyin parser2
This commit is contained in:
parent
944e222f32
commit
b011cca277
@ -0,0 +1,35 @@
|
||||
From ad094960b7844a026e65c4d2aafb674783694a08 Mon Sep 17 00:00:00 2001
|
||||
From: Peng Wu <alexepico@gmail.com>
|
||||
Date: Mon, 13 Feb 2012 13:26:12 +0800
|
||||
Subject: [PATCH] improves full pinyin parser
|
||||
|
||||
---
|
||||
src/storage/pinyin_parser2.cpp | 5 ++++-
|
||||
1 files changed, 4 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp
|
||||
index 80a525b..defc9fe 100644
|
||||
--- a/src/storage/pinyin_parser2.cpp
|
||||
+++ b/src/storage/pinyin_parser2.cpp
|
||||
@@ -345,7 +345,9 @@ int FullPinyinParser2::parse (pinyin_option_t options, ChewingKeyVector & keys,
|
||||
#endif
|
||||
|
||||
/* dynamic programming here. */
|
||||
- for (size_t m = i; m < next_sep; ++m) {
|
||||
+ /* for (size_t m = i; m < next_sep; ++m) */
|
||||
+ {
|
||||
+ size_t m = i;
|
||||
curstep = &g_array_index(m_parse_steps, parse_value_t, m);
|
||||
size_t try_len = std_lite::min
|
||||
(m + max_full_pinyin_length, next_sep);
|
||||
@@ -379,6 +381,7 @@ int FullPinyinParser2::parse (pinyin_option_t options, ChewingKeyVector & keys,
|
||||
if (value.m_parsed_len == nextstep->m_parsed_len &&
|
||||
value.m_num_keys < nextstep->m_num_keys)
|
||||
*nextstep = value;
|
||||
+
|
||||
if (value.m_parsed_len == nextstep->m_parsed_len &&
|
||||
value.m_num_keys == nextstep->m_num_keys) {
|
||||
|
||||
--
|
||||
1.7.7.6
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: libpinyin
|
||||
Version: 0.5.91
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: Library to deal with pinyin
|
||||
|
||||
License: GPLv2+
|
||||
@ -83,6 +83,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
|
||||
%{_mandir}/man1/*.1.*
|
||||
|
||||
%changelog
|
||||
* Tue Feb 14 2012 Peng Wu <pwu@redhat.com> - 0.5.91-2
|
||||
- Improves full pinyin parser2
|
||||
|
||||
* Mon Feb 13 2012 Peng Wu <pwu@redhat.com> - 0.5.91-1
|
||||
- Update to 0.5.91
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user