}
int main(int argc, char * argv[]){
-
setlocale(LC_ALL, "");
+ SystemTableInfo system_table_info;
+
+ bool retval = system_table_info.load("../../data/table.conf");
+ if (!retval) {
+ fprintf(stderr, "load table.conf failed.\n");
+ exit(ENOENT);
+ }
+
/* init phrase table */
FacadePhraseTable2 phrase_table;
MemoryChunk * chunk = new MemoryChunk;
chunk->load("../../data/phrase_index.bin");
phrase_table.load(chunk, NULL);
+ const pinyin_table_info_t * phrase_files =
+ system_table_info.get_table_info();
+
/* init phrase index */
FacadePhraseIndex phrase_index;
- if (!load_phrase_index(&phrase_index))
+ if (!load_phrase_index(phrase_files, &phrase_index))
exit(ENOENT);
/* init bi-gram */
size_t bench_times = 100;
int main( int argc, char * argv[]){
+ SystemTableInfo system_table_info;
+
+ bool retval = system_table_info.load("../../data/table.conf");
+ if (!retval) {
+ fprintf(stderr, "load table.conf failed.\n");
+ exit(ENOENT);
+ }
pinyin_option_t options =
USE_TONE | USE_RESPLIT_TABLE | PINYIN_CORRECT_ALL | PINYIN_AMB_ALL;
chunk->load("../../data/pinyin_index.bin");
largetable.load(options, chunk, NULL);
+ const pinyin_table_info_t * phrase_files =
+ system_table_info.get_table_info();
+
FacadePhraseIndex phrase_index;
- if (!load_phrase_index(&phrase_index))
+ if (!load_phrase_index(phrase_files, &phrase_index))
exit(ENOENT);
Bigram system_bigram;