Skip to content

Commit

Permalink
fixes ChewingKey
Browse files Browse the repository at this point in the history
  • Loading branch information
epico committed Jul 4, 2016
1 parent acf8ccd commit 8bb2978
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/storage/chewing_key.h
Expand Up @@ -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,
Expand All @@ -59,6 +61,7 @@ struct _ChewingKey
m_middle = middle;
m_final = final;
m_tone = CHEWING_ZERO_TONE;
m_zero_padding = 0;
}

public:
Expand Down
6 changes: 2 additions & 4 deletions src/storage/pinyin_phrase3.h
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 8bb2978

Please sign in to comment.