summaryrefslogtreecommitdiffstats
path: root/src/lookup/phrase_lookup.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-04-18 16:29:17 +0800
committerPeng Wu <alexepico@gmail.com>2011-04-18 16:29:17 +0800
commit0b113f330653b82be8a87af8b8b4ac826e72b296 (patch)
tree82913c0d378d19c353622e497210034ca3808d42 /src/lookup/phrase_lookup.cpp
parent647b365bbf25bc1e8db10aa26427fddbbbaf4626 (diff)
downloadlibpinyin-0b113f330653b82be8a87af8b8b4ac826e72b296.tar.gz
libpinyin-0b113f330653b82be8a87af8b8b4ac826e72b296.tar.xz
libpinyin-0b113f330653b82be8a87af8b8b4ac826e72b296.zip
refine bi-gram
Diffstat (limited to 'src/lookup/phrase_lookup.cpp')
-rw-r--r--src/lookup/phrase_lookup.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lookup/phrase_lookup.cpp b/src/lookup/phrase_lookup.cpp
index 86c9077..96069da 100644
--- a/src/lookup/phrase_lookup.cpp
+++ b/src/lookup/phrase_lookup.cpp
@@ -32,10 +32,12 @@ const gfloat PhraseLookup::unigram_lambda;
PhraseLookup::PhraseLookup(PhraseLargeTable * phrase_table,
FacadePhraseIndex * phrase_index,
- Bigram * bigram){
+ Bigram * system_bigram,
+ Bigram * user_bigram){
m_phrase_table = phrase_table;
m_phrase_index = phrase_index;
- m_bigram = bigram;
+ m_system_bigram = system_bigram;
+ m_user_bigram = user_bigram;
m_steps_index = g_ptr_array_new();
m_steps_content = g_ptr_array_new();
@@ -123,7 +125,9 @@ bool PhraseLookup::search_bigram(int nstep, phrase_token_t token){
lookup_value_t * cur_value = &g_array_index(lookup_content, lookup_value_t, i);
phrase_token_t index_token = cur_value->m_handles[1];
SingleGram * system, * user;
- m_bigram->load(index_token, system, user);
+ m_system_bigram->load(index_token, system);
+ m_user_bigram->load(index_token, user);
+
if ( system && user ){
guint32 total_freq;
assert(user->get_total_freq(total_freq));