summaryrefslogtreecommitdiffstats
path: root/utils/training/estimate_interpolation.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-04-27 15:50:40 +0800
committerPeng Wu <alexepico@gmail.com>2011-04-27 15:50:40 +0800
commitc44fa3478994e94d0fea8f2984c1d45515ec7024 (patch)
tree34f4fd66c94d751d8537e7dff30bd0f95d745899 /utils/training/estimate_interpolation.cpp
parentb19ebbcbeb89f49decb318dcce94ff2824fcd412 (diff)
downloadlibpinyin-c44fa3478994e94d0fea8f2984c1d45515ec7024.tar.gz
libpinyin-c44fa3478994e94d0fea8f2984c1d45515ec7024.tar.xz
libpinyin-c44fa3478994e94d0fea8f2984c1d45515ec7024.zip
fixes code style
Diffstat (limited to 'utils/training/estimate_interpolation.cpp')
-rw-r--r--utils/training/estimate_interpolation.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/training/estimate_interpolation.cpp b/utils/training/estimate_interpolation.cpp
index feec95e..2c1f1a8 100644
--- a/utils/training/estimate_interpolation.cpp
+++ b/utils/training/estimate_interpolation.cpp
@@ -45,7 +45,7 @@ parameter_t compute_interpolation(SingleGram * deleted_bigram,
deleted_bigram->retrieve_all(array);
for ( int i = 0; i < array->len; ++i){
- BigramPhraseItemWithCount* item = &g_array_index(array, BigramPhraseItemWithCount, i);
+ BigramPhraseItemWithCount * item = &g_array_index(array, BigramPhraseItemWithCount, i);
//get the phrase token
phrase_token_t token = item->m_token;
guint32 deleted_count = item->m_count;
@@ -53,7 +53,7 @@ parameter_t compute_interpolation(SingleGram * deleted_bigram,
{
guint32 freq = 0;
parameter_t elem_poss = 0;
- if ( bigram && bigram->get_freq(token, freq)){
+ if (bigram && bigram->get_freq(token, freq)){
guint32 total_freq;
assert(bigram->get_total_freq(total_freq));
assert(0 != total_freq);
@@ -71,10 +71,10 @@ parameter_t compute_interpolation(SingleGram * deleted_bigram,
guint32 total_freq = unigram->get_phrase_index_total_freq();
elem_poss = freq / (parameter_t)total_freq;
}
- part_of_denominator = ( 1 - lambda) * elem_poss;
+ part_of_denominator = (1 - lambda) * elem_poss;
}
- if ( 0 == (numerator + part_of_denominator))
+ if (0 == (numerator + part_of_denominator))
continue;
next_lambda += deleted_count * (numerator / (numerator + part_of_denominator));