summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-06 17:56:59 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-06 17:56:59 +0800
commitb22d3305a927528a1c134eb6a875e5dc478a885a (patch)
tree2250b3c661d2bb3273b7de29daf9fdba6a23bd2a /src
parent51ef74bdc4cd8df6049c6a5603b4c31524d70b31 (diff)
downloadlibpinyin-b22d3305a927528a1c134eb6a875e5dc478a885a.tar.gz
libpinyin-b22d3305a927528a1c134eb6a875e5dc478a885a.tar.xz
libpinyin-b22d3305a927528a1c134eb6a875e5dc478a885a.zip
fixes chewing large table
Diffstat (limited to 'src')
-rw-r--r--src/storage/chewing_large_table.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/storage/chewing_large_table.cpp b/src/storage/chewing_large_table.cpp
index d1b0d91..bddd1c5 100644
--- a/src/storage/chewing_large_table.cpp
+++ b/src/storage/chewing_large_table.cpp
@@ -432,6 +432,7 @@ int ChewingArrayIndexLevel<phrase_length>::convert
if (null_token == cursor.m_range_begin) {
cursor.m_range_begin = token;
cursor.m_range_end = token + 1;
+ cursor_head = head;
} else if (cursor.m_range_end == token &&
PHRASE_INDEX_LIBRARY_INDEX(cursor.m_range_begin) ==
PHRASE_INDEX_LIBRARY_INDEX(token)) {
@@ -647,6 +648,11 @@ bool ChewingLargeTable::load_text(FILE * infile) {
pinyin_option_t options = USE_TONE;
parser.parse(options, keys, key_rests, pinyin, strlen(pinyin));
+ if (0 == keys->len) {
+ fprintf(stderr, "%s\t%s\t%u\t%ld\n", pinyin, phrase, token, freq);
+ continue;
+ }
+
add_index(keys->len, (ChewingKey *)keys->data, token);
g_array_free(keys, TRUE);