From 69bbefcd562e080cc3283dff623e67f6431d71e8 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 9 Dec 2011 15:25:28 +0800 Subject: port gen_binary_files.cpp --- utils/storage/gen_binary_files.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'utils') diff --git a/utils/storage/gen_binary_files.cpp b/utils/storage/gen_binary_files.cpp index 5d8dfa6..4bca2cb 100644 --- a/utils/storage/gen_binary_files.cpp +++ b/utils/storage/gen_binary_files.cpp @@ -47,8 +47,8 @@ int main(int argc, char * argv[]){ } /* generate pinyin index*/ - PinyinCustomSettings custom; - PinyinLargeTable pinyinlargetable(&custom); + pinyin_option_t options = USE_TONE; + ChewingLargeTable chewinglargetable(options); PhraseLargeTable phraselargetable; /* generate phrase index */ @@ -63,8 +63,7 @@ int main(int argc, char * argv[]){ exit(ENOENT); } - pinyinlargetable.load_text(gbfile); - + chewinglargetable.load_text(gbfile); fseek(gbfile, 0L, SEEK_SET); phraselargetable.load_text(gbfile); fseek(gbfile, 0L, SEEK_SET); @@ -80,8 +79,7 @@ int main(int argc, char * argv[]){ exit(ENOENT); } - pinyinlargetable.load_text(gbkfile); - + chewinglargetable.load_text(gbkfile); fseek(gbkfile, 0L, SEEK_SET); phraselargetable.load_text(gbkfile); fseek(gbkfile, 0L, SEEK_SET); @@ -89,9 +87,9 @@ int main(int argc, char * argv[]){ fclose(gbkfile); MemoryChunk * new_chunk = new MemoryChunk; - pinyinlargetable.store(new_chunk); + chewinglargetable.store(new_chunk); new_chunk->save("pinyin_index.bin"); - pinyinlargetable.load(new_chunk); + chewinglargetable.load(new_chunk); new_chunk = new MemoryChunk; phraselargetable.store(new_chunk); -- cgit