diff options
-rw-r--r-- | src/pinyin_internal.h | 1 | ||||
-rw-r--r-- | utils/segment/ngseg.cpp | 6 | ||||
-rw-r--r-- | utils/segment/spseg.cpp | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/pinyin_internal.h b/src/pinyin_internal.h index 9bb7b42..3f97efa 100644 --- a/src/pinyin_internal.h +++ b/src/pinyin_internal.h @@ -53,6 +53,7 @@ #define USER_TABLE_INFO "user.conf" #define SYSTEM_BIGRAM "bigram.db" #define USER_BIGRAM "user_bigram.db" +#define DELETED_BIGRAM "deleted_bigram.db" #define SYSTEM_PINYIN_INDEX "pinyin_index.bin" #define USER_PINYIN_INDEX "user_pinyin_index.bin" #define SYSTEM_PHRASE_INDEX "phrase_index.bin" diff --git a/utils/segment/ngseg.cpp b/utils/segment/ngseg.cpp index fee7449..03fe5b4 100644 --- a/utils/segment/ngseg.cpp +++ b/utils/segment/ngseg.cpp @@ -136,7 +136,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); @@ -145,7 +145,7 @@ int main(int argc, char * argv[]){ /* init phrase table */ FacadePhraseTable2 phrase_table; MemoryChunk * chunk = new MemoryChunk; - chunk->load("phrase_index.bin"); + chunk->load(SYSTEM_PHRASE_INDEX); phrase_table.load(chunk, NULL); /* init phrase index */ @@ -159,7 +159,7 @@ int main(int argc, char * argv[]){ /* init bi-gram */ Bigram system_bigram; - system_bigram.attach("bigram.db", ATTACH_READONLY); + system_bigram.attach(SYSTEM_BIGRAM, ATTACH_READONLY); Bigram user_bigram; gfloat lambda = system_table_info.get_lambda(); diff --git a/utils/segment/spseg.cpp b/utils/segment/spseg.cpp index 1978c97..b543cc5 100644 --- a/utils/segment/spseg.cpp +++ b/utils/segment/spseg.cpp @@ -176,7 +176,9 @@ bool deal_with_segmentable(FacadePhraseTable2 * phrase_table, fprintf(output, "%d %s\n", step->m_handle, string); g_free(string); } + g_array_free(strings, TRUE); + return true; } bool deal_with_unknown(GArray * current_ucs4, FILE * output){ @@ -228,7 +230,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); @@ -237,7 +239,7 @@ int main(int argc, char * argv[]){ /* init phrase table */ FacadePhraseTable2 phrase_table; MemoryChunk * chunk = new MemoryChunk; - chunk->load("phrase_index.bin"); + chunk->load(SYSTEM_PHRASE_INDEX); phrase_table.load(chunk, NULL); /* init phrase index */ |