From 958b212c3ac1750950b050442ec7320ff7a7d1bf Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 24 Jul 2020 15:04:25 +0800 Subject: update pinyin.cpp and zhuyin.cpp --- src/pinyin.cpp | 9 ++++++--- src/zhuyin.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 75eb41b..5381fdf 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -1208,9 +1208,10 @@ bool pinyin_parse_full_pinyin(pinyin_instance_t * instance, pinyin_context_t * & context = instance->m_context; pinyin_option_t options = context->m_options; + gint16 distance = 0; int pinyin_len = strlen(onepinyin); bool retval = context->m_full_pinyin_parser->parse_one_key - (options, *onekey, onepinyin, pinyin_len); + (options, *onekey, distance, onepinyin, pinyin_len); return retval; } @@ -1249,9 +1250,10 @@ bool pinyin_parse_double_pinyin(pinyin_instance_t * instance, pinyin_context_t * & context = instance->m_context; pinyin_option_t options = context->m_options; + gint16 distance = 0; int pinyin_len = strlen(onepinyin); bool retval = context->m_double_pinyin_parser->parse_one_key - (options, *onekey, onepinyin, pinyin_len); + (options, *onekey, distance, onepinyin, pinyin_len); return retval; } @@ -1289,9 +1291,10 @@ bool pinyin_parse_chewing(pinyin_instance_t * instance, /* disable the zhuyin correction options. */ options &= ~ZHUYIN_CORRECT_ALL; + gint16 distance = 0; int chewing_len = strlen(onechewing); bool retval = context->m_chewing_parser->parse_one_key - (options, *onekey, onechewing, chewing_len ); + (options, *onekey, distance, onechewing, chewing_len ); return retval; } diff --git a/src/zhuyin.cpp b/src/zhuyin.cpp index cb3ce70..1b9cda5 100644 --- a/src/zhuyin.cpp +++ b/src/zhuyin.cpp @@ -1007,9 +1007,10 @@ bool zhuyin_parse_full_pinyin(zhuyin_instance_t * instance, /* disable the pinyin correction options. */ options &= ~PINYIN_CORRECT_ALL; + gint16 distance = 0; int pinyin_len = strlen(onepinyin); bool retval = context->m_full_pinyin_parser->parse_one_key - (options, *onekey, onepinyin, pinyin_len); + (options, *onekey, distance, onepinyin, pinyin_len); return retval; } @@ -1047,9 +1048,10 @@ bool zhuyin_parse_chewing(zhuyin_instance_t * instance, zhuyin_context_t * & context = instance->m_context; zhuyin_option_t options = context->m_options; + gint16 distance = 0; int chewing_len = strlen(onechewing); bool retval = context->m_chewing_parser->parse_one_key - (options, *onekey, onechewing, chewing_len ); + (options, *onekey, distance, onechewing, chewing_len); return retval; } -- cgit