summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-01-20 14:01:44 +0800
committerPeng Wu <alexepico@gmail.com>2017-01-20 14:01:44 +0800
commit5ae06cef759839aff771b94952a52c25a5502e5e (patch)
treef9e01383051c8174d28731a682ce77db81854d13
parent8b603e06de3cad13918970175478333cca687bfc (diff)
downloadlibpinyin-5ae06cef759839aff771b94952a52c25a5502e5e.tar.gz
libpinyin-5ae06cef759839aff771b94952a52c25a5502e5e.tar.xz
libpinyin-5ae06cef759839aff771b94952a52c25a5502e5e.zip
write save_next_step method
-rw-r--r--src/lookup/phonetic_lookup.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lookup/phonetic_lookup.h b/src/lookup/phonetic_lookup.h
index a21aca6..11297e0 100644
--- a/src/lookup/phonetic_lookup.h
+++ b/src/lookup/phonetic_lookup.h
@@ -582,7 +582,7 @@ protected:
next_step.m_last_step = start;
next_step.m_sub_index = cur_step->m_current_index;
- return save_next_step(end, cur_step, &next_step);
+ return save_next_step(end, &next_step);
}
bool bigram_gen_next_step(int start, int end,
@@ -612,10 +612,13 @@ protected:
next_step.m_last_step = start;
next_step.m_sub_index = cur_step->m_current_index;
- return save_next_step(end, cur_step, &next_step);
+ return save_next_step(end, &next_step);
}
- bool save_next_step(int next_step_pos, trellis_value_t * cur_step, trellis_value_t * next_step);
+ bool save_next_step(int index, trellis_value_t * candidate) {
+ lookup_key_t token = candidate->m_handles[1];
+ m_trellis.insert_candidate(index, token, candidate);
+ }
public: