From 8bb2978cfe90b179f60bd242434eb397d9fa380a Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 4 Jul 2016 14:11:03 +0800 Subject: fixes ChewingKey --- src/storage/chewing_key.h | 3 +++ src/storage/pinyin_phrase3.h | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/storage/chewing_key.h b/src/storage/chewing_key.h index 3229cae..733dd4c 100644 --- a/src/storage/chewing_key.h +++ b/src/storage/chewing_key.h @@ -45,12 +45,14 @@ struct _ChewingKey guint16 m_middle : 2; guint16 m_final : 5; guint16 m_tone : 3; + guint16 m_zero_padding : 1; _ChewingKey() { m_initial = CHEWING_ZERO_INITIAL; m_middle = CHEWING_ZERO_MIDDLE; m_final = CHEWING_ZERO_FINAL; m_tone = CHEWING_ZERO_TONE; + m_zero_padding = 0; } _ChewingKey(ChewingInitial initial, ChewingMiddle middle, @@ -59,6 +61,7 @@ struct _ChewingKey m_middle = middle; m_final = final; m_tone = CHEWING_ZERO_TONE; + m_zero_padding = 0; } public: diff --git a/src/storage/pinyin_phrase3.h b/src/storage/pinyin_phrase3.h index 19d56d8..b93c8e7 100644 --- a/src/storage/pinyin_phrase3.h +++ b/src/storage/pinyin_phrase3.h @@ -172,10 +172,8 @@ inline void compute_incomplete_chewing_index(const ChewingKey * in_keys, ChewingKey * out_keys, int phrase_length) { for (int i = 0; i < phrase_length; ++i) { - ChewingKey key = in_keys[i]; - key.m_middle = CHEWING_ZERO_MIDDLE; - key.m_final = CHEWING_ZERO_FINAL; - key.m_tone = CHEWING_ZERO_TONE; + ChewingKey key; + key.m_initial = in_keys[i].m_initial; out_keys[i] = key; } } -- cgit