summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-01-20 10:51:13 +0800
committerPeng Wu <alexepico@gmail.com>2017-01-20 10:51:13 +0800
commitc43f884dcb230ff7a29d5b05d53880ef37ecf85e (patch)
tree1248a5422684ec17a2f02fad50d0e189956750f0 /src
parent8003335fa85e0061d27779c5070c0336d9a4a1d4 (diff)
downloadlibpinyin-c43f884dcb230ff7a29d5b05d53880ef37ecf85e.tar.gz
libpinyin-c43f884dcb230ff7a29d5b05d53880ef37ecf85e.tar.xz
libpinyin-c43f884dcb230ff7a29d5b05d53880ef37ecf85e.zip
fixes typos
Diffstat (limited to 'src')
-rw-r--r--src/lookup/phonetic_lookup.h4
-rw-r--r--src/lookup/phonetic_lookup_heap.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lookup/phonetic_lookup.h b/src/lookup/phonetic_lookup.h
index 6c5dc8d..ba3c11e 100644
--- a/src/lookup/phonetic_lookup.h
+++ b/src/lookup/phonetic_lookup.h
@@ -62,7 +62,7 @@ static bool inline trellis_value_less_than(const trellis_value_t * exist_item,
if (nbest > 1) {
/* allow longer sentence */
if (exist_item->m_sentence_length + 1 == new_item->m_sentence_length &&
- exist_item->m_poss * LONG_SENTENCE_PENALTY < new_item->m_poss)
+ exist_item->m_poss + LONG_SENTENCE_PENALTY < new_item->m_poss)
return true;
}
@@ -76,7 +76,7 @@ static bool inline trellis_value_less_than(const trellis_value_t * exist_item,
if (nbest > 1) {
/* allow longer sentence */
if (exist_item->m_sentence_length == new_item->m_sentence_length + 1 &&
- exist_item->m_poss < new_item->m_poss * LONG_SENTENCE_PENALTY)
+ exist_item->m_poss < new_item->m_poss + LONG_SENTENCE_PENALTY)
return true;
}
diff --git a/src/lookup/phonetic_lookup_heap.h b/src/lookup/phonetic_lookup_heap.h
index bd64955..ac25768 100644
--- a/src/lookup/phonetic_lookup_heap.h
+++ b/src/lookup/phonetic_lookup_heap.h
@@ -98,7 +98,7 @@ public:
/* return true if the item is stored into m_element. */
bool eval_item(const trellis_value_t * item) {
- if (compare_tellis_value<nbest>(&m_element, item)) {
+ if (trellis_value_less_than<1>(&m_element, item)) {
m_element = *item;
return true;
}