diff options
author | Peng Wu <alexepico@gmail.com> | 2011-12-09 15:25:28 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-12-09 15:25:28 +0800 |
commit | 69bbefcd562e080cc3283dff623e67f6431d71e8 (patch) | |
tree | 54034d75f7f2f09f651bd9fa7acfdafef3f952d1 /utils/storage | |
parent | 50b8d01371708313ec063178f9819ee6230487d7 (diff) | |
download | libpinyin-69bbefcd562e080cc3283dff623e67f6431d71e8.tar.gz libpinyin-69bbefcd562e080cc3283dff623e67f6431d71e8.tar.xz libpinyin-69bbefcd562e080cc3283dff623e67f6431d71e8.zip |
port gen_binary_files.cpp
Diffstat (limited to 'utils/storage')
-rw-r--r-- | utils/storage/gen_binary_files.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
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); |