diff options
| author | Peng Wu <alexepico@gmail.com> | 2022-06-06 17:32:00 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2022-06-06 17:32:00 +0800 |
| commit | 2323c59d337ca56c585a8b58b855e84938ecfc27 (patch) | |
| tree | dc32a1af5a593170bd6149d361521832f1885ca5 /utils/training | |
| parent | 5f3df104b5ac0c3497a48cfc476eb3eedf1e543b (diff) | |
| download | libpinyin-2323c59d337ca56c585a8b58b855e84938ecfc27.tar.gz libpinyin-2323c59d337ca56c585a8b58b855e84938ecfc27.tar.xz libpinyin-2323c59d337ca56c585a8b58b855e84938ecfc27.zip | |
Use abort function instead of assert macro
Diffstat (limited to 'utils/training')
| -rw-r--r-- | utils/training/gen_k_mixture_model.cpp | 4 | ||||
| -rw-r--r-- | utils/training/import_k_mixture_model.cpp | 6 | ||||
| -rw-r--r-- | utils/training/k_mixture_model.h | 2 | ||||
| -rw-r--r-- | utils/training/k_mixture_model_to_interpolation.cpp | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/utils/training/gen_k_mixture_model.cpp b/utils/training/gen_k_mixture_model.cpp index 4595433..94969a4 100644 --- a/utils/training/gen_k_mixture_model.cpp +++ b/utils/training/gen_k_mixture_model.cpp @@ -168,7 +168,7 @@ static void train_word_pair(HashofUnigram hash_of_unigram, check_result(g_hash_table_steal(hash_of_unigram, GUINT_TO_POINTER(token2))); } else { - assert(FALSE); + abort(); } return; } @@ -195,7 +195,7 @@ static void train_word_pair(HashofUnigram hash_of_unigram, check_result(g_hash_table_steal(hash_of_unigram, GUINT_TO_POINTER(token2))); } else { - assert(FALSE); + abort(); } return; } diff --git a/utils/training/import_k_mixture_model.cpp b/utils/training/import_k_mixture_model.cpp index 6503dbf..45f8d5e 100644 --- a/utils/training/import_k_mixture_model.cpp +++ b/utils/training/import_k_mixture_model.cpp @@ -130,7 +130,7 @@ bool parse_body(FILE * input, PhraseLargeTable3 * phrase_table, parse_bigram(input, phrase_table, phrase_index, bigram); goto retry; default: - assert(FALSE); + abort(); } } while (my_getline(input) != -1) ; @@ -170,7 +170,7 @@ bool parse_unigram(FILE * input, PhraseLargeTable3 * phrase_table, case GRAM_2_LINE: goto end; default: - assert(FALSE); + abort(); } } while (my_getline(input) != -1); @@ -244,7 +244,7 @@ bool parse_bigram(FILE * input, PhraseLargeTable3 * phrase_table, case GRAM_2_LINE: goto end; default: - assert(FALSE); + abort(); } } while (my_getline(input) != -1); diff --git a/utils/training/k_mixture_model.h b/utils/training/k_mixture_model.h index 3e5eb32..3fa1dc9 100644 --- a/utils/training/k_mixture_model.h +++ b/utils/training/k_mixture_model.h @@ -79,7 +79,7 @@ static inline parameter_t compute_Pr_G_3(corpus_count_t k, return (alpha * gamma / (B - 1)) * pow((1 - 1 / (B - 1)) , k - 2); } - assert(FALSE); + abort(); } static inline parameter_t compute_Pr_G_3_with_count(corpus_count_t k, diff --git a/utils/training/k_mixture_model_to_interpolation.cpp b/utils/training/k_mixture_model_to_interpolation.cpp index 3c425ac..3a549a6 100644 --- a/utils/training/k_mixture_model_to_interpolation.cpp +++ b/utils/training/k_mixture_model_to_interpolation.cpp @@ -105,7 +105,7 @@ bool parse_body(FILE * input, FILE * output){ parse_bigram(input, output); goto retry; default: - assert(FALSE); + abort(); } } while (my_getline(input) != -1); @@ -143,7 +143,7 @@ bool parse_unigram(FILE * input, FILE * output){ case GRAM_2_LINE: goto end; default: - assert(FALSE); + abort(); } } while (my_getline(input) != -1); @@ -180,7 +180,7 @@ bool parse_bigram(FILE * input, FILE * output){ case GRAM_2_LINE: goto end; default: - assert(FALSE); + abort(); } } while (my_getline(input) != -1); |
