summaryrefslogtreecommitdiffstats
path: root/utils/training/gen_ngram.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/training/gen_ngram.cpp')
-rw-r--r--utils/training/gen_ngram.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/utils/training/gen_ngram.cpp b/utils/training/gen_ngram.cpp
index 9db5d58..2ade331 100644
--- a/utils/training/gen_ngram.cpp
+++ b/utils/training/gen_ngram.cpp
@@ -2,7 +2,7 @@
* libpinyin
* Library to deal with pinyin.
*
- * Copyright (C) 2006-2007 Peng Wu
+ * Copyright (C) 2006-2007, 2011 Peng Wu
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,14 +29,13 @@
static PhraseLargeTable * g_phrases = NULL;
void print_help(){
- printf("gen_ngram [--skip-pi-gram-training] [--skip-unigram-training]\n");
+ printf("gen_ngram [--skip-pi-gram-training]\n");
printf(" [--bigram-file <FILENAME>]\n");
}
int main(int argc, char * argv[]){
int i = 1;
bool train_pi_gram = true;
- bool train_unigram = true;
const char * bigram_filename = "../../data/bigram.db";
setlocale(LC_ALL, "");
@@ -46,8 +45,6 @@ int main(int argc, char * argv[]){
exit(0);
}else if ( strcmp("--skip-pi-gram-training", argv[i]) == 0 ){
train_pi_gram = false;
- }else if ( strcmp("--skip-unigram-training", argv[i]) == 0 ){
- train_unigram = false;
}else if ( strcmp("--bigram-file", argv[i]) == 0){
if ( ++i >= argc ) {
print_help();
@@ -117,8 +114,7 @@ int main(int argc, char * argv[]){
cur_token = token;
if ( cur_token ){
//training uni-gram
- if ( train_unigram )
- phrase_index.add_unigram_frequency(cur_token, 1);
+ phrase_index.add_unigram_frequency(cur_token, 1);
}
if ( cur_token ){
SingleGram * single_gram = NULL;