From 34de36eabbc3baac56885e01fa2ec79ba7fb5cc6 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 21 May 2012 14:56:50 +0800 Subject: write save_phrase_index --- utils/training/gen_unigram.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'utils/training/gen_unigram.cpp') diff --git a/utils/training/gen_unigram.cpp b/utils/training/gen_unigram.cpp index 470a60a..f94c214 100644 --- a/utils/training/gen_unigram.cpp +++ b/utils/training/gen_unigram.cpp @@ -52,15 +52,8 @@ int main(int argc, char * argv[]){ } #endif - MemoryChunk * new_chunk = new MemoryChunk; - phrase_index.store(1, new_chunk); - new_chunk->save("gb_char.bin"); - phrase_index.load(1, new_chunk); - - new_chunk = new MemoryChunk; - phrase_index.store(2, new_chunk); - new_chunk->save("gbk_char.bin"); - phrase_index.load(2, new_chunk); + if (!save_phrase_index(&phrase_index)) + exit(ENOENT); return 0; } -- cgit