From fe54b6c86d94e95cd38026d4d84c7b05859a8d4f Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 29 Apr 2015 15:54:47 +0800 Subject: fixes space key display --- src/storage/chewing_table.h | 2 +- src/storage/pinyin_parser2.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/storage') diff --git a/src/storage/chewing_table.h b/src/storage/chewing_table.h index 661be86..fb36d64 100644 --- a/src/storage/chewing_table.h +++ b/src/storage/chewing_table.h @@ -490,7 +490,7 @@ const chewing_tone_item_t chewing_dachen_cp26_tones[] = { const char * chewing_tone_table[CHEWING_NUMBER_OF_TONES] = { "", -"ˉ", +" ", "ˊ", "ˇ", "ˋ", diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index 51f3ae8..f78653f 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -1289,6 +1289,11 @@ bool ChewingDirectParser2::parse_one_key(pinyin_option_t options, break; } } + + /* check the force tone option. */ + if (options & FORCE_TONE && CHEWING_ZERO_TONE == tone) { + return false; + } } gchar * chewing = g_strndup(str, len); @@ -1334,7 +1339,7 @@ int ChewingDirectParser2::parse(pinyin_option_t options, return parsed_len; } - /* skip consecutive spaces */ + /* skip consecutive spaces. */ for (i = next; i < len; ++i) { if (' ' != str[i] && '\'' != str[i]) break; -- cgit