summaryrefslogtreecommitdiffstats
path: root/src/lookup/pinyin_lookup.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2010-08-16 15:21:19 +0800
committerPeng Wu <alexepico@gmail.com>2010-08-16 15:21:19 +0800
commite9df591634a8f1cd7cbea6fdf8d1a9fa46401b03 (patch)
tree2ffb73a6f9f8e88f143fa60f96894d5e1c5f83ac /src/lookup/pinyin_lookup.cpp
parent535860f63095e2d877290b657d864a10cd11c9cd (diff)
downloadlibpinyin-e9df591634a8f1cd7cbea6fdf8d1a9fa46401b03.tar.gz
libpinyin-e9df591634a8f1cd7cbea6fdf8d1a9fa46401b03.tar.xz
libpinyin-e9df591634a8f1cd7cbea6fdf8d1a9fa46401b03.zip
fixes pinyin lookup
Diffstat (limited to 'src/lookup/pinyin_lookup.cpp')
-rw-r--r--src/lookup/pinyin_lookup.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lookup/pinyin_lookup.cpp b/src/lookup/pinyin_lookup.cpp
index 5beab26..0b5cf4d 100644
--- a/src/lookup/pinyin_lookup.cpp
+++ b/src/lookup/pinyin_lookup.cpp
@@ -309,7 +309,7 @@ bool PinyinLookup::search_bigram(IBranchIterator * iter,
bool PinyinLookup::unigram_gen_next_step(int nstep, lookup_value_t * cur_step, phrase_token_t token){
PinyinKey * pinyinkeys = ((PinyinKey *)m_keys->data) + nstep;
- if (!m_phrase_index->get_phrase_item(token, m_cache_phrase_item))
+ if (m_phrase_index->get_phrase_item(token, m_cache_phrase_item))
return false;
size_t phrase_length = m_cache_phrase_item.get_phrase_length();
gfloat elem_poss = m_cache_phrase_item.get_unigram_frequency() / (gfloat)
@@ -329,7 +329,7 @@ bool PinyinLookup::unigram_gen_next_step(int nstep, lookup_value_t * cur_step, p
bool PinyinLookup::bigram_gen_next_step(int nstep, lookup_value_t * cur_step, phrase_token_t token, gfloat bigram_poss){
PinyinKey * pinyinkeys = ((PinyinKey *)m_keys->data) + nstep;
- if (!m_phrase_index->get_phrase_item(token, m_cache_phrase_item))
+ if (m_phrase_index->get_phrase_item(token, m_cache_phrase_item))
return false;
size_t phrase_length = m_cache_phrase_item.get_phrase_length();
gfloat unigram_poss = m_cache_phrase_item.get_unigram_frequency() / (gfloat)
@@ -498,7 +498,7 @@ bool PinyinLookup::convert_to_utf8(MatchResults results, /* out */ char * & resu
}
bool PinyinLookup::add_constraint(CandidateConstraints constraints, size_t index, phrase_token_t token){
- if ( !m_phrase_index->get_phrase_item(token, m_cache_phrase_item) )
+ if ( m_phrase_index->get_phrase_item(token, m_cache_phrase_item) )
return false;
size_t phrase_length = m_cache_phrase_item.get_phrase_length();
@@ -535,7 +535,7 @@ bool PinyinLookup::clear_constraint(CandidateConstraints constraints, size_t ind
assert(constraint->m_type == CONSTRAINT_ONESTEP);
phrase_token_t token = constraint->m_token;
- if (!m_phrase_index->get_phrase_item(token, m_cache_phrase_item))
+ if (m_phrase_index->get_phrase_item(token, m_cache_phrase_item))
return false;
size_t phrase_length = m_cache_phrase_item.get_phrase_length();