From 6db008752cfad90cd6c839f1776429ecee68948d Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 2 Dec 2011 11:08:09 +0800 Subject: fixes double pinyin parser --- src/storage/pinyin_parser2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/storage/pinyin_parser2.cpp') diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index 568380c..7e98b4d 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -23,6 +23,7 @@ #include "pinyin_parser2.h" #include #include +#include #include #include "stl_lite.h" #include "pinyin_phrase2.h" @@ -528,7 +529,8 @@ int DoublePinyinParser2::parse(pinyin_option_t options, ChewingKeyVector & keys, int maximum_len = 0; int i; /* probe the longest possible double pinyin string. */ for (i = 0; i < len; ++i) { - if (!IS_KEY(str[i])) + const char ch = str[i]; + if (!(IS_KEY(ch) || ('0' < ch && ch <= '5'))) break; } maximum_len = i; -- cgit