Hello community, here is the log from the commit of package fcitx-cloudpinyin for openSUSE:Factory checked in at 2014-06-10 14:38:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fcitx-cloudpinyin (Old) and /work/SRC/openSUSE:Factory/.fcitx-cloudpinyin.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fcitx-cloudpinyin" Changes: -------- --- /work/SRC/openSUSE:Factory/fcitx-cloudpinyin/fcitx-cloudpinyin.changes 2014-02-19 06:54:14.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.fcitx-cloudpinyin.new/fcitx-cloudpinyin.changes 2014-06-10 14:38:56.000000000 +0200 @@ -1,0 +2,6 @@ +Mon Jun 9 04:59:18 UTC 2014 - [email protected] + +- update version 0.3.4 + * better shuangpin and separator support + +------------------------------------------------------------------- Old: ---- fcitx-cloudpinyin-0.3.3.tar.xz New: ---- fcitx-cloudpinyin-0.3.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fcitx-cloudpinyin.spec ++++++ --- /var/tmp/diff_new_pack.nov1yh/_old 2014-06-10 14:38:57.000000000 +0200 +++ /var/tmp/diff_new_pack.nov1yh/_new 2014-06-10 14:38:57.000000000 +0200 @@ -17,7 +17,7 @@ Name: fcitx-cloudpinyin -Version: 0.3.3 +Version: 0.3.4 Release: 0 Summary: Cloudpinyin module for fcitx License: GPL-2.0+ ++++++ fcitx-cloudpinyin-0.3.3.tar.xz -> fcitx-cloudpinyin-0.3.4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.3/po/de.po new/fcitx-cloudpinyin-0.3.4/po/de.po --- old/fcitx-cloudpinyin-0.3.3/po/de.po 2013-11-11 17:28:24.000000000 +0100 +++ new/fcitx-cloudpinyin-0.3.4/po/de.po 2013-11-29 06:49:11.000000000 +0100 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: fcitx\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2013-10-31 06:02-0400\n" +"POT-Creation-Date: 2013-11-11 12:02-0500\n" "PO-Revision-Date: 2013-10-31 05:29+0000\n" "Last-Translator: mar well <[email protected]>\n" "Language-Team: German (http://www.transifex.com/projects/p/fcitx/language/" @@ -19,7 +19,7 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/cloudpinyin.c:679 +#: src/cloudpinyin.c:681 msgid " (via cloud)" msgstr " (via cloud)" @@ -27,11 +27,11 @@ msgid "Add Cloud Pinyin Support to Pinyin Input Method" msgstr "Füge Cloud Pinyin Unterstützung zur Pinyin Eingabemethode hinzu" -#: src/fcitx-cloudpinyin.desc:26 +#: src/fcitx-cloudpinyin.desc:24 msgid "Baidu" msgstr "Baidu" -#: src/cloudpinyin.c:614 src/fcitx-cloudpinyin.conf.in:3 +#: src/cloudpinyin.c:616 src/fcitx-cloudpinyin.conf.in:3 msgid "Cloud Pinyin" msgstr "Cloud Pinyin" @@ -43,21 +43,21 @@ msgid "Cloud Pinyin Source" msgstr "Cloudpinyin Quelle" -#: src/cloudpinyin.c:616 +#: src/cloudpinyin.c:618 msgid "Cloud Pinyin is Disabled." msgstr "Cloudpinyin ist ausgeschaltet" -#: src/cloudpinyin.c:615 +#: src/cloudpinyin.c:617 msgid "Cloud Pinyin is Enabled." msgstr "Cloudpinyin ist eingeschaltet" #: src/fcitx-cloudpinyin.desc:1 src/fcitx-cloudpinyin.desc:7 #: src/fcitx-cloudpinyin.desc:13 src/fcitx-cloudpinyin.desc:18 -#: src/fcitx-cloudpinyin.desc:28 src/fcitx-cloudpinyin.desc:34 +#: src/fcitx-cloudpinyin.desc:26 src/fcitx-cloudpinyin.desc:32 msgid "CloudPinyin" msgstr "CloudPinyin" -#: src/fcitx-cloudpinyin.desc:32 +#: src/fcitx-cloudpinyin.desc:30 msgid "Disable Cloud Pinyin When you are using mobile can save your network" msgstr "" "Das Deaktivieren von Cloudpinyin kann in mobilen Netzwerken Traffic " @@ -67,11 +67,11 @@ msgid "Don't Show the 'via cloud' hint" msgstr "Den Hinweis 'via cloud' nicht zeigen" -#: src/fcitx-cloudpinyin.desc:37 +#: src/fcitx-cloudpinyin.desc:35 msgid "Enabled" msgstr "Aktiviert" -#: src/fcitx-cloudpinyin.desc:25 +#: src/fcitx-cloudpinyin.desc:23 msgid "Google" msgstr "Google" @@ -79,14 +79,12 @@ msgid "Minimum Length of Pinyin To Trigger Cloud Pinyin" msgstr "Minimale Länge von Pinyin, um Cloud Pinyin zu aktivieren" -#: src/fcitx-cloudpinyin.desc:24 -msgid "QQ" -msgstr "QQ" - -#: src/fcitx-cloudpinyin.desc:23 -msgid "Sogou" -msgstr "Sogou" - -#: src/fcitx-cloudpinyin.desc:31 +#: src/fcitx-cloudpinyin.desc:29 msgid "Toggle Cloud Pinyin enabled status" msgstr "Verberge den \"Cloud Pinyin aktiviert\" Status" + +#~ msgid "QQ" +#~ msgstr "QQ" + +#~ msgid "Sogou" +#~ msgstr "Sogou" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.3/po/fcitx-cloudpinyin.pot new/fcitx-cloudpinyin-0.3.4/po/fcitx-cloudpinyin.pot --- old/fcitx-cloudpinyin-0.3.3/po/fcitx-cloudpinyin.pot 2013-11-11 17:28:24.000000000 +0100 +++ new/fcitx-cloudpinyin-0.3.4/po/fcitx-cloudpinyin.pot 2013-11-29 06:49:11.000000000 +0100 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2013-06-30 01:44-0400\n" +"POT-Creation-Date: 2013-11-11 12:02-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <[email protected]>\n" @@ -17,19 +17,19 @@ "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/cloudpinyin.c:613 src/fcitx-cloudpinyin.conf.in:3 +#: src/cloudpinyin.c:616 src/fcitx-cloudpinyin.conf.in:3 msgid "Cloud Pinyin" msgstr "" -#: src/cloudpinyin.c:614 +#: src/cloudpinyin.c:617 msgid "Cloud Pinyin is Enabled." msgstr "" -#: src/cloudpinyin.c:615 +#: src/cloudpinyin.c:618 msgid "Cloud Pinyin is Disabled." msgstr "" -#: src/cloudpinyin.c:678 +#: src/cloudpinyin.c:681 msgid " (via cloud)" msgstr "" @@ -39,7 +39,7 @@ #: src/fcitx-cloudpinyin.desc:1 src/fcitx-cloudpinyin.desc:7 #: src/fcitx-cloudpinyin.desc:13 src/fcitx-cloudpinyin.desc:18 -#: src/fcitx-cloudpinyin.desc:28 src/fcitx-cloudpinyin.desc:34 +#: src/fcitx-cloudpinyin.desc:26 src/fcitx-cloudpinyin.desc:32 msgid "CloudPinyin" msgstr "" @@ -60,29 +60,21 @@ msgstr "" #: src/fcitx-cloudpinyin.desc:23 -msgid "Sogou" -msgstr "" - -#: src/fcitx-cloudpinyin.desc:24 -msgid "QQ" -msgstr "" - -#: src/fcitx-cloudpinyin.desc:25 msgid "Google" msgstr "" -#: src/fcitx-cloudpinyin.desc:26 +#: src/fcitx-cloudpinyin.desc:24 msgid "Baidu" msgstr "" -#: src/fcitx-cloudpinyin.desc:31 +#: src/fcitx-cloudpinyin.desc:29 msgid "Toggle Cloud Pinyin enabled status" msgstr "" -#: src/fcitx-cloudpinyin.desc:32 +#: src/fcitx-cloudpinyin.desc:30 msgid "Disable Cloud Pinyin When you are using mobile can save your network" msgstr "" -#: src/fcitx-cloudpinyin.desc:37 +#: src/fcitx-cloudpinyin.desc:35 msgid "Enabled" msgstr "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.3/po/ja.po new/fcitx-cloudpinyin-0.3.4/po/ja.po --- old/fcitx-cloudpinyin-0.3.3/po/ja.po 2013-11-11 17:28:24.000000000 +0100 +++ new/fcitx-cloudpinyin-0.3.4/po/ja.po 2013-11-29 06:49:11.000000000 +0100 @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: fcitx\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2013-08-07 12:02-0400\n" +"POT-Creation-Date: 2013-11-11 12:02-0500\n" "PO-Revision-Date: 2013-08-07 15:02+0000\n" "Last-Translator: しろう\n" "Language-Team: Japanese (http://www.transifex.com/projects/p/fcitx/language/" @@ -20,7 +20,7 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: src/cloudpinyin.c:678 +#: src/cloudpinyin.c:681 msgid " (via cloud)" msgstr "(クラウド使用)" @@ -28,11 +28,11 @@ msgid "Add Cloud Pinyin Support to Pinyin Input Method" msgstr "Pinyin 入力メソッドにクラウド Pinyin サポートを追加" -#: src/fcitx-cloudpinyin.desc:26 +#: src/fcitx-cloudpinyin.desc:24 msgid "Baidu" msgstr "Baidu" -#: src/cloudpinyin.c:613 src/fcitx-cloudpinyin.conf.in:3 +#: src/cloudpinyin.c:616 src/fcitx-cloudpinyin.conf.in:3 msgid "Cloud Pinyin" msgstr "クラウド Pinyin" @@ -44,21 +44,21 @@ msgid "Cloud Pinyin Source" msgstr "クラウド Pinyin 提供元" -#: src/cloudpinyin.c:615 +#: src/cloudpinyin.c:618 msgid "Cloud Pinyin is Disabled." msgstr "クラウド Pinyinが無効になりました。" -#: src/cloudpinyin.c:614 +#: src/cloudpinyin.c:617 msgid "Cloud Pinyin is Enabled." msgstr "クラウド Pinyinが有効になりました。" #: src/fcitx-cloudpinyin.desc:1 src/fcitx-cloudpinyin.desc:7 #: src/fcitx-cloudpinyin.desc:13 src/fcitx-cloudpinyin.desc:18 -#: src/fcitx-cloudpinyin.desc:28 src/fcitx-cloudpinyin.desc:34 +#: src/fcitx-cloudpinyin.desc:26 src/fcitx-cloudpinyin.desc:32 msgid "CloudPinyin" msgstr "クラウド Pinyin" -#: src/fcitx-cloudpinyin.desc:32 +#: src/fcitx-cloudpinyin.desc:30 msgid "Disable Cloud Pinyin When you are using mobile can save your network" msgstr "" "モバイル端末の時にネットワークを消費しないために、クラウド Pinyinを無効化する" @@ -67,11 +67,11 @@ msgid "Don't Show the 'via cloud' hint" msgstr "'クラウドで' のヒントを表示しない" -#: src/fcitx-cloudpinyin.desc:37 +#: src/fcitx-cloudpinyin.desc:35 msgid "Enabled" msgstr "有効" -#: src/fcitx-cloudpinyin.desc:25 +#: src/fcitx-cloudpinyin.desc:23 msgid "Google" msgstr "Google" @@ -79,14 +79,12 @@ msgid "Minimum Length of Pinyin To Trigger Cloud Pinyin" msgstr "クラウド Pinyin を開始する最低 Pinyin 数" -#: src/fcitx-cloudpinyin.desc:24 -msgid "QQ" -msgstr "QQ" - -#: src/fcitx-cloudpinyin.desc:23 -msgid "Sogou" -msgstr "Sogou" - -#: src/fcitx-cloudpinyin.desc:31 +#: src/fcitx-cloudpinyin.desc:29 msgid "Toggle Cloud Pinyin enabled status" msgstr "クラウド Pinyin が有効/無効を切り替え" + +#~ msgid "QQ" +#~ msgstr "QQ" + +#~ msgid "Sogou" +#~ msgstr "Sogou" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.3/po/zh_CN.po new/fcitx-cloudpinyin-0.3.4/po/zh_CN.po --- old/fcitx-cloudpinyin-0.3.3/po/zh_CN.po 2013-11-11 17:28:24.000000000 +0100 +++ new/fcitx-cloudpinyin-0.3.4/po/zh_CN.po 2013-11-29 06:49:11.000000000 +0100 @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: fcitx\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2013-10-26 14:42-0400\n" +"POT-Creation-Date: 2013-11-11 12:02-0500\n" "PO-Revision-Date: 2013-06-30 05:51+0000\n" "Last-Translator: Xuetian Weng <[email protected]>\n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/fcitx/" @@ -21,7 +21,7 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: src/cloudpinyin.c:679 +#: src/cloudpinyin.c:681 msgid " (via cloud)" msgstr " (来自云)" @@ -29,11 +29,11 @@ msgid "Add Cloud Pinyin Support to Pinyin Input Method" msgstr "为拼音输入法加入云拼音支持" -#: src/fcitx-cloudpinyin.desc:26 +#: src/fcitx-cloudpinyin.desc:24 msgid "Baidu" msgstr "百度" -#: src/cloudpinyin.c:614 src/fcitx-cloudpinyin.conf.in:3 +#: src/cloudpinyin.c:616 src/fcitx-cloudpinyin.conf.in:3 msgid "Cloud Pinyin" msgstr "云拼音" @@ -45,21 +45,21 @@ msgid "Cloud Pinyin Source" msgstr "云拼音来源" -#: src/cloudpinyin.c:616 +#: src/cloudpinyin.c:618 msgid "Cloud Pinyin is Disabled." msgstr "云拼音已禁用。" -#: src/cloudpinyin.c:615 +#: src/cloudpinyin.c:617 msgid "Cloud Pinyin is Enabled." msgstr "云拼音已启用。" #: src/fcitx-cloudpinyin.desc:1 src/fcitx-cloudpinyin.desc:7 #: src/fcitx-cloudpinyin.desc:13 src/fcitx-cloudpinyin.desc:18 -#: src/fcitx-cloudpinyin.desc:28 src/fcitx-cloudpinyin.desc:34 +#: src/fcitx-cloudpinyin.desc:26 src/fcitx-cloudpinyin.desc:32 msgid "CloudPinyin" msgstr "云拼音" -#: src/fcitx-cloudpinyin.desc:32 +#: src/fcitx-cloudpinyin.desc:30 msgid "Disable Cloud Pinyin When you are using mobile can save your network" msgstr "在使用移动网络时禁用云拼音可以节省流量" @@ -67,11 +67,11 @@ msgid "Don't Show the 'via cloud' hint" msgstr "不显示‘来自云’提示" -#: src/fcitx-cloudpinyin.desc:37 +#: src/fcitx-cloudpinyin.desc:35 msgid "Enabled" msgstr "启用" -#: src/fcitx-cloudpinyin.desc:25 +#: src/fcitx-cloudpinyin.desc:23 msgid "Google" msgstr "Google" @@ -79,14 +79,12 @@ msgid "Minimum Length of Pinyin To Trigger Cloud Pinyin" msgstr "最小触发云拼音的拼音长度" -#: src/fcitx-cloudpinyin.desc:24 -msgid "QQ" -msgstr "QQ" - -#: src/fcitx-cloudpinyin.desc:23 -msgid "Sogou" -msgstr "搜狗" - -#: src/fcitx-cloudpinyin.desc:31 +#: src/fcitx-cloudpinyin.desc:29 msgid "Toggle Cloud Pinyin enabled status" msgstr "切换云拼音启用状态" + +#~ msgid "QQ" +#~ msgstr "QQ" + +#~ msgid "Sogou" +#~ msgstr "搜狗" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.3/po/zh_TW.po new/fcitx-cloudpinyin-0.3.4/po/zh_TW.po --- old/fcitx-cloudpinyin-0.3.3/po/zh_TW.po 2013-11-11 17:28:24.000000000 +0100 +++ new/fcitx-cloudpinyin-0.3.4/po/zh_TW.po 2013-11-29 06:49:11.000000000 +0100 @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: fcitx\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2013-06-30 06:02-0400\n" +"POT-Creation-Date: 2013-11-11 12:02-0500\n" "PO-Revision-Date: 2013-06-30 05:50+0000\n" "Last-Translator: Xuetian Weng <[email protected]>\n" "Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/fcitx/" @@ -20,7 +20,7 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: src/cloudpinyin.c:678 +#: src/cloudpinyin.c:681 msgid " (via cloud)" msgstr "(來自雲)" @@ -28,11 +28,11 @@ msgid "Add Cloud Pinyin Support to Pinyin Input Method" msgstr "為拼音輸入法加入雲拼音支援" -#: src/fcitx-cloudpinyin.desc:26 +#: src/fcitx-cloudpinyin.desc:24 msgid "Baidu" msgstr "百度" -#: src/cloudpinyin.c:613 src/fcitx-cloudpinyin.conf.in:3 +#: src/cloudpinyin.c:616 src/fcitx-cloudpinyin.conf.in:3 msgid "Cloud Pinyin" msgstr "雲拼音" @@ -44,21 +44,21 @@ msgid "Cloud Pinyin Source" msgstr "雲拼音來源" -#: src/cloudpinyin.c:615 +#: src/cloudpinyin.c:618 msgid "Cloud Pinyin is Disabled." msgstr "" -#: src/cloudpinyin.c:614 +#: src/cloudpinyin.c:617 msgid "Cloud Pinyin is Enabled." msgstr "" #: src/fcitx-cloudpinyin.desc:1 src/fcitx-cloudpinyin.desc:7 #: src/fcitx-cloudpinyin.desc:13 src/fcitx-cloudpinyin.desc:18 -#: src/fcitx-cloudpinyin.desc:28 src/fcitx-cloudpinyin.desc:34 +#: src/fcitx-cloudpinyin.desc:26 src/fcitx-cloudpinyin.desc:32 msgid "CloudPinyin" msgstr "雲拼音" -#: src/fcitx-cloudpinyin.desc:32 +#: src/fcitx-cloudpinyin.desc:30 msgid "Disable Cloud Pinyin When you are using mobile can save your network" msgstr "使用行動網路時停用雲拼音以節省流量" @@ -66,11 +66,11 @@ msgid "Don't Show the 'via cloud' hint" msgstr "不顯示「來自雲」提示" -#: src/fcitx-cloudpinyin.desc:37 +#: src/fcitx-cloudpinyin.desc:35 msgid "Enabled" msgstr "啟用" -#: src/fcitx-cloudpinyin.desc:25 +#: src/fcitx-cloudpinyin.desc:23 msgid "Google" msgstr "Google" @@ -78,14 +78,12 @@ msgid "Minimum Length of Pinyin To Trigger Cloud Pinyin" msgstr "最小觸發雲拼音的拼音長度" -#: src/fcitx-cloudpinyin.desc:24 -msgid "QQ" -msgstr "QQ" - -#: src/fcitx-cloudpinyin.desc:23 -msgid "Sogou" -msgstr "搜狗" - -#: src/fcitx-cloudpinyin.desc:31 +#: src/fcitx-cloudpinyin.desc:29 msgid "Toggle Cloud Pinyin enabled status" msgstr "切換雲拼音啟用狀態" + +#~ msgid "QQ" +#~ msgstr "QQ" + +#~ msgid "Sogou" +#~ msgstr "搜狗" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-cloudpinyin-0.3.3/src/cloudpinyin.c new/fcitx-cloudpinyin-0.3.4/src/cloudpinyin.c --- old/fcitx-cloudpinyin-0.3.3/src/cloudpinyin.c 2013-11-11 17:28:24.000000000 +0100 +++ new/fcitx-cloudpinyin-0.3.4/src/cloudpinyin.c 2013-11-29 06:49:11.000000000 +0100 @@ -72,6 +72,7 @@ const char* RequestPinyin; void (*ParseKey)(FcitxCloudPinyin* cloudpinyin, CurlQueue* queue); char* (*ParsePinyin)(FcitxCloudPinyin* cloudpinyin, CurlQueue* queue); + boolean supportSeparator; } CloudPinyinEngine; static void* CloudPinyinCreate(FcitxInstance* instance); @@ -119,13 +120,15 @@ NULL, "https://www.google.com/inputtools/request?ime=pinyin&text=%s", NULL, - GoogleParsePinyin + GoogleParsePinyin, + true }, { NULL, "http://olime.baidu.com/py?py=%s&rn=0&pn=1&ol=1", NULL, - BaiduParsePinyin + BaiduParsePinyin, + true } }; @@ -870,27 +873,45 @@ size_t plength = hzlength; strncpy(p, string, hzlength); p[hzlength] = '\0'; + // lastpos points to the start of a pinyin + // pinyin points to the end of current pinyin + // for example + // xi'an + // | | + // l p + // and we check the separator by supportSeparator for each engine. + // shuangpin-libpinyin returns full pinyin in preedit, so we also treat space as separator. do { endflag = (*pinyin != '\0'); if (*pinyin == ' ' || *pinyin == '\'' || *pinyin == '\0') { - *pinyin = 0; + boolean isSeparator = false; + + // skip all continous separator + while (*pinyin == ' ' || *pinyin == '\'') { + isSeparator = isSeparator || (*pinyin) == '\'' || (strcmp(im->uniqueName, "shuangpin-libpinyin") == 0 && (*pinyin) == ' '); + *pinyin = 0; + pinyin++; + } if (*lastpos != '\0') { char* result = NULL; boolean isshuangpin = false; if (strcmp(im->uniqueName, "sunpinyin") == 0) { FCITX_DEF_MODULE_ARGS(args, lastpos, &isshuangpin); - result = FcitxSunPinyinInvokeGetFullPinyin( - cloudpinyin->owner, args); + result = FcitxSunPinyinInvokeGetFullPinyin(cloudpinyin->owner, args); } else if (strcmp(im->uniqueName, "shuangpin") == 0) { isshuangpin = true; result = FcitxPinyinSP2QP(cloudpinyin->owner, lastpos); } if (isshuangpin) { if (result) { - if (plength + strlen(result) < MAX_USER_INPUT) { + if (plength + strlen(result) + (engine[cloudpinyin->config.source].supportSeparator ? 1 : 0) < MAX_USER_INPUT) { strcat(p + plength, result); plength += strlen(result); + if (engine[cloudpinyin->config.source].supportSeparator) { + strcat(p + plength, "'"); + plength += 1; + } free(result); } else { p[hzlength] = '\0'; @@ -898,18 +919,26 @@ } } } else { - if (plength + strlen(lastpos) < MAX_USER_INPUT) { +#define PINYIN_USE_SEPARATOR_CASE (isSeparator && engine[cloudpinyin->config.source].supportSeparator) + if (plength + strlen(lastpos) + (PINYIN_USE_SEPARATOR_CASE ? 1 : 0) < MAX_USER_INPUT) { strcat(p + plength, lastpos); plength += strlen(lastpos); + if (PINYIN_USE_SEPARATOR_CASE) { + strcat(p + plength, "'"); + plength += 1; + } } else { p[hzlength] = '\0'; break; } } + + isSeparator = false; } - lastpos = pinyin + 1; + lastpos = pinyin; + } else { + pinyin ++; } - pinyin ++; } while(endflag); free(string); /* no pinyin append, return NULL for off it */ @@ -917,6 +946,9 @@ *ascii_part = NULL; return NULL; } else { + if (plength >= 1 && p[plength - 1] == '\'') { + p[plength - 1] = '\0'; + } char *res = strdup(p); *ascii_part = res + hzlength; return res; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
