summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils/training/estimate_interpolation.cpp14
-rw-r--r--utils/training/eval_correction_rate.cpp14
-rw-r--r--utils/training/export_k_mixture_model.cpp14
-rw-r--r--utils/training/gen_deleted_ngram.cpp14
-rw-r--r--utils/training/gen_k_mixture_model.cpp14
-rw-r--r--utils/training/import_k_mixture_model.cpp14
6 files changed, 78 insertions, 6 deletions
diff --git a/utils/training/estimate_interpolation.cpp b/utils/training/estimate_interpolation.cpp
index 9d3a96f..15b1bdc 100644
--- a/utils/training/estimate_interpolation.cpp
+++ b/utils/training/estimate_interpolation.cpp
@@ -89,8 +89,20 @@ parameter_t compute_interpolation(SingleGram * deleted_bigram,
}
int main(int argc, char * argv[]){
+ SystemTableInfo system_table_info;
+
+ bool retval = system_table_info.load("table.conf");
+ if (!retval) {
+ fprintf(stderr, "load table.conf failed.\n");
+ exit(ENOENT);
+ }
+
FacadePhraseIndex phrase_index;
- if (!load_phrase_index(&phrase_index))
+
+ const pinyin_table_info_t * phrase_files =
+ system_table_info.get_table_info();
+
+ if (!load_phrase_index(phrase_files, &phrase_index))
exit(ENOENT);
Bigram bigram;
diff --git a/utils/training/eval_correction_rate.cpp b/utils/training/eval_correction_rate.cpp
index dd4d434..a4d8f63 100644
--- a/utils/training/eval_correction_rate.cpp
+++ b/utils/training/eval_correction_rate.cpp
@@ -116,6 +116,14 @@ bool do_one_test(PinyinLookup2 * pinyin_lookup,
int main(int argc, char * argv[]){
const char * evals_text = "evals2.text";
+ SystemTableInfo system_table_info;
+
+ bool retval = system_table_info.load("table.conf");
+ if (!retval) {
+ fprintf(stderr, "load table.conf failed.\n");
+ exit(ENOENT);
+ }
+
pinyin_option_t options = USE_TONE;
FacadeChewingTable largetable;
@@ -129,7 +137,11 @@ int main(int argc, char * argv[]){
phrase_table.load(chunk, NULL);
FacadePhraseIndex phrase_index;
- if (!load_phrase_index(&phrase_index))
+
+ const pinyin_table_info_t * phrase_files =
+ system_table_info.get_table_info();
+
+ if (!load_phrase_index(phrase_files, &phrase_index))
exit(ENOENT);
Bigram system_bigram;
diff --git a/utils/training/export_k_mixture_model.cpp b/utils/training/export_k_mixture_model.cpp
index ddb971e..90ec2b5 100644
--- a/utils/training/export_k_mixture_model.cpp
+++ b/utils/training/export_k_mixture_model.cpp
@@ -124,8 +124,20 @@ int main(int argc, char * argv[]){
exit(EINVAL);
}
+ SystemTableInfo system_table_info;
+
+ bool retval = system_table_info.load("table.conf");
+ if (!retval) {
+ fprintf(stderr, "load table.conf failed.\n");
+ exit(ENOENT);
+ }
+
FacadePhraseIndex phrase_index;
- if (!load_phrase_index(&phrase_index))
+
+ const pinyin_table_info_t * phrase_files =
+ system_table_info.get_table_info();
+
+ if (!load_phrase_index(phrase_files, &phrase_index))
exit(ENOENT);
KMixtureModelBigram bigram(K_MIXTURE_MODEL_MAGIC_NUMBER);
diff --git a/utils/training/gen_deleted_ngram.cpp b/utils/training/gen_deleted_ngram.cpp
index 0437a68..5044d92 100644
--- a/utils/training/gen_deleted_ngram.cpp
+++ b/utils/training/gen_deleted_ngram.cpp
@@ -51,6 +51,14 @@ int main(int argc, char * argv[]){
exit(EINVAL);
}
+ SystemTableInfo system_table_info;
+
+ bool retval = system_table_info.load("table.conf");
+ if (!retval) {
+ fprintf(stderr, "load table.conf failed.\n");
+ exit(ENOENT);
+ }
+
/* load phrase table. */
PhraseLargeTable2 phrase_table;
MemoryChunk * new_chunk = new MemoryChunk;
@@ -58,7 +66,11 @@ int main(int argc, char * argv[]){
phrase_table.load(new_chunk);
FacadePhraseIndex phrase_index;
- if (!load_phrase_index(&phrase_index))
+
+ const pinyin_table_info_t * phrase_files =
+ system_table_info.get_table_info();
+
+ if (!load_phrase_index(phrase_files, &phrase_index))
exit(ENODATA);
Bigram bigram;
diff --git a/utils/training/gen_k_mixture_model.cpp b/utils/training/gen_k_mixture_model.cpp
index efa760d..915aa3a 100644
--- a/utils/training/gen_k_mixture_model.cpp
+++ b/utils/training/gen_k_mixture_model.cpp
@@ -329,13 +329,25 @@ int main(int argc, char * argv[]){
exit(EINVAL);
}
+ SystemTableInfo system_table_info;
+
+ bool retval = system_table_info.load("table.conf");
+ if (!retval) {
+ fprintf(stderr, "load table.conf failed.\n");
+ exit(ENOENT);
+ }
+
PhraseLargeTable2 phrase_table;
MemoryChunk * chunk = new MemoryChunk;
chunk->load("phrase_index.bin");
phrase_table.load(chunk);
FacadePhraseIndex phrase_index;
- if (!load_phrase_index(&phrase_index))
+
+ const pinyin_table_info_t * phrase_files =
+ system_table_info.get_table_info();
+
+ if (!load_phrase_index(phrase_files, &phrase_index))
exit(ENOENT);
KMixtureModelBigram bigram(K_MIXTURE_MODEL_MAGIC_NUMBER);
diff --git a/utils/training/import_k_mixture_model.cpp b/utils/training/import_k_mixture_model.cpp
index f842764..168f6d1 100644
--- a/utils/training/import_k_mixture_model.cpp
+++ b/utils/training/import_k_mixture_model.cpp
@@ -271,13 +271,25 @@ int main(int argc, char * argv[]){
exit(EINVAL);
}
+ SystemTableInfo system_table_info;
+
+ bool retval = system_table_info.load("table.conf");
+ if (!retval) {
+ fprintf(stderr, "load table.conf failed.\n");
+ exit(ENOENT);
+ }
+
PhraseLargeTable2 phrase_table;
MemoryChunk * chunk = new MemoryChunk;
chunk->load("phrase_index.bin");
phrase_table.load(chunk);
FacadePhraseIndex phrase_index;
- if (!load_phrase_index(&phrase_index))
+
+ const pinyin_table_info_t * phrase_files =
+ system_table_info.get_table_info();
+
+ if (!load_phrase_index(phrase_files, &phrase_index))
exit(ENOENT);
KMixtureModelBigram bigram(K_MIXTURE_MODEL_MAGIC_NUMBER);