diff options
author | Peng Wu <alexepico@gmail.com> | 2012-09-04 12:55:13 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-09-04 12:57:21 +0800 |
commit | f917d5add0b3d67b2577b094614ab563bad73679 (patch) | |
tree | 479d0077b436c5a01ec01307a0cece1c60438210 /utils | |
parent | 9569248cb69d52a57cbb227c9312953545cea35a (diff) | |
download | libpinyin-f917d5add0b3d67b2577b094614ab563bad73679.tar.gz libpinyin-f917d5add0b3d67b2577b094614ab563bad73679.tar.xz libpinyin-f917d5add0b3d67b2577b094614ab563bad73679.zip |
add clear_tokens call
Diffstat (limited to 'utils')
-rw-r--r-- | utils/training/gen_deleted_ngram.cpp | 3 | ||||
-rw-r--r-- | utils/training/gen_k_mixture_model.cpp | 1 | ||||
-rw-r--r-- | utils/training/gen_ngram.cpp | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/utils/training/gen_deleted_ngram.cpp b/utils/training/gen_deleted_ngram.cpp index abc3ee9..fe0a9d9 100644 --- a/utils/training/gen_deleted_ngram.cpp +++ b/utils/training/gen_deleted_ngram.cpp @@ -88,7 +88,8 @@ int main(int argc, char * argv[]){ phrase_token_t token = null_token; if ( 0 != phrase_len ) { - int result = phrase_table.search( phrase_len, phrase, tokens); + phrase_index.clear_tokens(tokens); + int result = phrase_table.search(phrase_len, phrase, tokens); int num = get_first_token(tokens, token); if ( !(result & SEARCH_OK) ) diff --git a/utils/training/gen_k_mixture_model.cpp b/utils/training/gen_k_mixture_model.cpp index c8bc5f2..c8a8b38 100644 --- a/utils/training/gen_k_mixture_model.cpp +++ b/utils/training/gen_k_mixture_model.cpp @@ -70,6 +70,7 @@ bool read_document(PhraseLargeTable2 * phrase_table, phrase_token_t token = null_token; if ( 0 != phrase_len ) { + phrase_index->clear_tokens(tokens); int search_result = phrase_table->search (phrase_len, phrase, tokens); int num = get_first_token(tokens, token); diff --git a/utils/training/gen_ngram.cpp b/utils/training/gen_ngram.cpp index 20448b1..983f967 100644 --- a/utils/training/gen_ngram.cpp +++ b/utils/training/gen_ngram.cpp @@ -87,6 +87,7 @@ int main(int argc, char * argv[]){ phrase_token_t token = null_token; if ( 0 != phrase_len ) { + phrase_index.clear_tokens(tokens); int result = phrase_table.search(phrase_len, phrase, tokens); int num = get_first_token(tokens, token); if ( !(result & SEARCH_OK) ) |