projects
/
platform
/
upstream
/
libpinyin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd310c1
)
improves full pinyin parse_one_key
author
Peng Wu
<alexepico@gmail.com>
Tue, 22 Nov 2011 09:05:17 +0000
(17:05 +0800)
committer
Peng Wu
<alexepico@gmail.com>
Tue, 22 Nov 2011 09:05:17 +0000
(17:05 +0800)
src/storage/pinyin_parser2.cpp
patch
|
blob
|
history
diff --git
a/src/storage/pinyin_parser2.cpp
b/src/storage/pinyin_parser2.cpp
index
9c5876c
..
3f3b5d9
100644
(file)
--- a/
src/storage/pinyin_parser2.cpp
+++ b/
src/storage/pinyin_parser2.cpp
@@
-177,11
+177,9
@@
bool FullPinyinParser2::parse_one_key (guint32 options, ChewingKey & key,
/* parse pinyin core staff here. */
/* Note: optimize here? */
- for (; parsed_len >= len - 1; --parsed_len) {
- input[parsed_len] = '\0';
- if (search_pinyin_index(options, input, key, key_rest))
- break;
- }
+ input[parsed_len] = '\0';
+ if (!search_pinyin_index(options, input, key, key_rest))
+ --parsed_len;
if (options & USE_TONE) {
/* post processing tone. */