fixes post_process2
authorPeng Wu <alexepico@gmail.com>
Fri, 30 Mar 2012 06:25:36 +0000 (14:25 +0800)
committerPeng Wu <alexepico@gmail.com>
Fri, 30 Mar 2012 06:25:36 +0000 (14:25 +0800)
src/storage/pinyin_parser2.cpp

index df9b5893ad651a3651a00c38bcacc8b32c15b77f..732598cceea8f8525c8a4a58a2cda4ced0333ade 100644 (file)
@@ -596,13 +596,19 @@ bool FullPinyinParser2::post_process2(pinyin_option_t options,
                 continue;
 
             const char * onepinyin = str + cur_rest->m_raw_begin;
-            size_t len = cur_rest->length();
+            size_t len = strlen(item->m_orig_keys[0]);
+
+            if (cur_rest->length() != len)
+                continue;
 
             if (0 != strncmp(onepinyin, item->m_orig_keys[0], len))
                 continue;
 
             onepinyin = str + next_rest->m_raw_begin;
-            len = next_rest->length();
+            len = strlen(item->m_orig_keys[1]);
+
+            if (next_rest->length() != len)
+                continue;
 
             if (0 == strncmp(onepinyin, item->m_orig_keys[1], len))
                 break;