bool pinyin_in_chewing_keyboard(pinyin_instance_t * instance,
const char key, const char ** symbol) {
pinyin_context_t * & context = instance->m_context;
- return context->m_chewing_parser->in_chewing_scheme(key, symbol);
+ return context->m_chewing_parser->in_chewing_scheme
+ (context->m_options, key, symbol);
}
int maximum_len = 0; int i;
/* probe the longest possible chewing string. */
for (i = 0; i < len; ++i) {
- if (!in_chewing_scheme(str[i], NULL))
+ if (!in_chewing_scheme(options, str[i], NULL))
break;
}
maximum_len = i;
}
-bool ChewingParser2::in_chewing_scheme(const char key, const char ** symbol)
+bool ChewingParser2::in_chewing_scheme(pinyin_option_t options,
+ const char key, const char ** symbol)
const {
const gchar * chewing = NULL;
char tone = CHEWING_ZERO_TONE;
return true;
}
+ if (!(options & USE_TONE))
+ return false;
+
if (search_chewing_tones(m_tone_table, key, &tone)) {
if (symbol)
*symbol = chewing_tone_table[tone];
public:
bool set_scheme(ChewingScheme scheme);
- bool in_chewing_scheme(const char key, const char ** symbol) const;
+ bool in_chewing_scheme(pinyin_option_t options, const char key, const char ** symbol) const;
};