summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-04-16 11:39:08 +0800
committerPeng Wu <alexepico@gmail.com>2013-04-16 11:39:08 +0800
commitedead27671841073511ba6ba521a8b5a261a9499 (patch)
tree10c825cbdd1ccc63141addf5c669cccca30a921c /utils
parenteacd9bb91f34141ea7564d35d4bea1c1c5f6682d (diff)
downloadlibpinyin-edead27671841073511ba6ba521a8b5a261a9499.zip
libpinyin-edead27671841073511ba6ba521a8b5a261a9499.tar.gz
libpinyin-edead27671841073511ba6ba521a8b5a261a9499.tar.xz
update utils/training
Diffstat (limited to 'utils')
-rw-r--r--utils/training/estimate_interpolation.cpp6
-rw-r--r--utils/training/eval_correction_rate.cpp8
-rw-r--r--utils/training/export_k_mixture_model.cpp2
-rw-r--r--utils/training/gen_deleted_ngram.cpp6
-rw-r--r--utils/training/gen_k_mixture_model.cpp4
-rw-r--r--utils/training/gen_ngram.cpp6
-rw-r--r--utils/training/gen_unigram.cpp2
-rw-r--r--utils/training/import_k_mixture_model.cpp4
8 files changed, 19 insertions, 19 deletions
diff --git a/utils/training/estimate_interpolation.cpp b/utils/training/estimate_interpolation.cpp
index 15b1bdc..5cdc680 100644
--- a/utils/training/estimate_interpolation.cpp
+++ b/utils/training/estimate_interpolation.cpp
@@ -91,7 +91,7 @@ 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");
+ bool retval = system_table_info.load(SYSTEM_TABLE_INFO);
if (!retval) {
fprintf(stderr, "load table.conf failed.\n");
exit(ENOENT);
@@ -106,10 +106,10 @@ int main(int argc, char * argv[]){
exit(ENOENT);
Bigram bigram;
- bigram.attach("bigram.db", ATTACH_READONLY);
+ bigram.attach(SYSTEM_BIGRAM, ATTACH_READONLY);
Bigram deleted_bigram;
- deleted_bigram.attach("deleted_bigram.db", ATTACH_READONLY);
+ deleted_bigram.attach(DELETED_BIGRAM, ATTACH_READONLY);
GArray * deleted_items = g_array_new(FALSE, FALSE, sizeof(phrase_token_t));
deleted_bigram.get_all_items(deleted_items);
diff --git a/utils/training/eval_correction_rate.cpp b/utils/training/eval_correction_rate.cpp
index c4883b0..b45781d 100644
--- a/utils/training/eval_correction_rate.cpp
+++ b/utils/training/eval_correction_rate.cpp
@@ -118,7 +118,7 @@ int main(int argc, char * argv[]){
SystemTableInfo system_table_info;
- bool retval = system_table_info.load("table.conf");
+ bool retval = system_table_info.load(SYSTEM_TABLE_INFO);
if (!retval) {
fprintf(stderr, "load table.conf failed.\n");
exit(ENOENT);
@@ -128,12 +128,12 @@ int main(int argc, char * argv[]){
FacadeChewingTable largetable;
MemoryChunk * chunk = new MemoryChunk;
- chunk->load("pinyin_index.bin");
+ chunk->load(SYSTEM_PINYIN_INDEX);
largetable.load(options, chunk, NULL);
FacadePhraseTable2 phrase_table;
chunk = new MemoryChunk;
- chunk->load("phrase_index.bin");
+ chunk->load(SYSTEM_PHRASE_INDEX);
phrase_table.load(chunk, NULL);
FacadePhraseIndex phrase_index;
@@ -145,7 +145,7 @@ int main(int argc, char * argv[]){
exit(ENOENT);
Bigram system_bigram;
- system_bigram.attach("bigram.db", ATTACH_READONLY);
+ system_bigram.attach(SYSTEM_BIGRAM, ATTACH_READONLY);
Bigram user_bigram;
user_bigram.attach(NULL, ATTACH_CREATE|ATTACH_READWRITE);
diff --git a/utils/training/export_k_mixture_model.cpp b/utils/training/export_k_mixture_model.cpp
index 90ec2b5..e446e79 100644
--- a/utils/training/export_k_mixture_model.cpp
+++ b/utils/training/export_k_mixture_model.cpp
@@ -126,7 +126,7 @@ int main(int argc, char * argv[]){
SystemTableInfo system_table_info;
- bool retval = system_table_info.load("table.conf");
+ bool retval = system_table_info.load(SYSTEM_TABLE_INFO);
if (!retval) {
fprintf(stderr, "load table.conf failed.\n");
exit(ENOENT);
diff --git a/utils/training/gen_deleted_ngram.cpp b/utils/training/gen_deleted_ngram.cpp
index 5044d92..b6f96fa 100644
--- a/utils/training/gen_deleted_ngram.cpp
+++ b/utils/training/gen_deleted_ngram.cpp
@@ -28,7 +28,7 @@
#include "utils_helper.h"
static gboolean train_pi_gram = TRUE;
-static const gchar * bigram_filename = "deleted_bigram.db";
+static const gchar * bigram_filename = DELETED_BIGRAM;
static GOptionEntry entries[] =
{
@@ -53,7 +53,7 @@ int main(int argc, char * argv[]){
SystemTableInfo system_table_info;
- bool retval = system_table_info.load("table.conf");
+ bool retval = system_table_info.load(SYSTEM_TABLE_INFO);
if (!retval) {
fprintf(stderr, "load table.conf failed.\n");
exit(ENOENT);
@@ -62,7 +62,7 @@ int main(int argc, char * argv[]){
/* load phrase table. */
PhraseLargeTable2 phrase_table;
MemoryChunk * new_chunk = new MemoryChunk;
- new_chunk->load("phrase_index.bin");
+ new_chunk->load(SYSTEM_PHRASE_INDEX);
phrase_table.load(new_chunk);
FacadePhraseIndex phrase_index;
diff --git a/utils/training/gen_k_mixture_model.cpp b/utils/training/gen_k_mixture_model.cpp
index 915aa3a..2dfb3d1 100644
--- a/utils/training/gen_k_mixture_model.cpp
+++ b/utils/training/gen_k_mixture_model.cpp
@@ -331,7 +331,7 @@ int main(int argc, char * argv[]){
SystemTableInfo system_table_info;
- bool retval = system_table_info.load("table.conf");
+ bool retval = system_table_info.load(SYSTEM_TABLE_INFO);
if (!retval) {
fprintf(stderr, "load table.conf failed.\n");
exit(ENOENT);
@@ -339,7 +339,7 @@ int main(int argc, char * argv[]){
PhraseLargeTable2 phrase_table;
MemoryChunk * chunk = new MemoryChunk;
- chunk->load("phrase_index.bin");
+ chunk->load(SYSTEM_PHRASE_INDEX);
phrase_table.load(chunk);
FacadePhraseIndex phrase_index;
diff --git a/utils/training/gen_ngram.cpp b/utils/training/gen_ngram.cpp
index b8e3bd1..1947959 100644
--- a/utils/training/gen_ngram.cpp
+++ b/utils/training/gen_ngram.cpp
@@ -28,7 +28,7 @@
#include "utils_helper.h"
static gboolean train_pi_gram = TRUE;
-static const gchar * bigram_filename = "bigram.db";
+static const gchar * bigram_filename = SYSTEM_BIGRAM;
static GOptionEntry entries[] =
{
@@ -54,7 +54,7 @@ int main(int argc, char * argv[]){
SystemTableInfo system_table_info;
- bool retval = system_table_info.load("table.conf");
+ bool retval = system_table_info.load(SYSTEM_TABLE_INFO);
if (!retval) {
fprintf(stderr, "load table.conf failed.\n");
exit(ENOENT);
@@ -63,7 +63,7 @@ int main(int argc, char * argv[]){
PhraseLargeTable2 phrase_table;
/* init phrase table */
MemoryChunk * chunk = new MemoryChunk;
- chunk->load("phrase_index.bin");
+ chunk->load(SYSTEM_PHRASE_INDEX);
phrase_table.load(chunk);
FacadePhraseIndex phrase_index;
diff --git a/utils/training/gen_unigram.cpp b/utils/training/gen_unigram.cpp
index 83a15c8..f4c51af 100644
--- a/utils/training/gen_unigram.cpp
+++ b/utils/training/gen_unigram.cpp
@@ -49,7 +49,7 @@ int main(int argc, char * argv[]){
SystemTableInfo system_table_info;
- gchar * filename = g_build_filename(table_dir, "table.conf", NULL);
+ gchar * filename = g_build_filename(table_dir, SYSTEM_TABLE_INFO, NULL);
bool retval = system_table_info.load(filename);
if (!retval) {
fprintf(stderr, "load table.conf failed.\n");
diff --git a/utils/training/import_k_mixture_model.cpp b/utils/training/import_k_mixture_model.cpp
index 168f6d1..d018b78 100644
--- a/utils/training/import_k_mixture_model.cpp
+++ b/utils/training/import_k_mixture_model.cpp
@@ -273,7 +273,7 @@ int main(int argc, char * argv[]){
SystemTableInfo system_table_info;
- bool retval = system_table_info.load("table.conf");
+ bool retval = system_table_info.load(SYSTEM_TABLE_INFO);
if (!retval) {
fprintf(stderr, "load table.conf failed.\n");
exit(ENOENT);
@@ -281,7 +281,7 @@ int main(int argc, char * argv[]){
PhraseLargeTable2 phrase_table;
MemoryChunk * chunk = new MemoryChunk;
- chunk->load("phrase_index.bin");
+ chunk->load(SYSTEM_PHRASE_INDEX);
phrase_table.load(chunk);
FacadePhraseIndex phrase_index;