diff --git a/honoka/plugins/asciiplugin.cpp b/honoka/plugins/asciiplugin.cpp index 75d2381..04dced4 100644 --- a/honoka/plugins/asciiplugin.cpp +++ b/honoka/plugins/asciiplugin.cpp @@ -55,6 +55,13 @@ _("At WordsPrediction, if you want to add a space after the committed word ,check it."), HONOKA_DEFAULT_WORDSPREDICTION_ADDSAW )); + page->append(new HonokaSetupIntItem( + _("_Limit of prediction results to display: "), + String(HONOKA_CONFIG_WORDSPREDICTION_LIMIT), + _("set the getting limit of prediction results. it doesn't display the results when the count of prediction results is more than this."), + HONOKA_DEFAULT_WORDSPREDICTION_LIMIT, + 1,1000 + )); page->append(new HonokaSetupKeyItem( _("Low priority key: "), String(HONOKA_CONFIG_ASCIIINPUT_LOW_PRIORITY_KEY), diff --git a/honoka/plugins/asciiplugin.h b/honoka/plugins/asciiplugin.h index 6ccf254..3bfe04e 100644 --- a/honoka/plugins/asciiplugin.h +++ b/honoka/plugins/asciiplugin.h @@ -37,6 +37,8 @@ #define HONOKA_DEFAULT_WORDSPREDICTION_FILE "/usr/share/dict/words" #define HONOKA_CONFIG_WORDSPREDICTION_ADDSAW "/IMEngine/Honoka/WordsPrediction/AddSpaceAfterWord" #define HONOKA_DEFAULT_WORDSPREDICTION_ADDSAW false +#define HONOKA_CONFIG_WORDSPREDICTION_LIMIT "/IMEngine/Honoka/WordsPrediction/LimitOfResults" +#define HONOKA_DEFAULT_WORDSPREDICTION_LIMIT 20 #define HONOKA_CONFIG_ASCIIINPUT_LOW_PRIORITY_KEY "/IMEngine/Honoka/AsciiInput/LowPriorityKey" #define HONOKA_DEFAULT_ASCIIINPUT_LOW_PRIORITY_KEY "" #define HONOKA_CONFIG_ASCIIINPUT_AUTO_COMMIT_KEY "/IMEngine/Honoka/AsciiInput/AutoCommitKey" diff --git a/honoka/plugins/wordsprediction.cpp b/honoka/plugins/wordsprediction.cpp index e10be2f..97289b0 100644 --- a/honoka/plugins/wordsprediction.cpp +++ b/honoka/plugins/wordsprediction.cpp @@ -44,6 +44,7 @@ dic = new WordsDic(file); pos = 0; addSpace = cfg->read(HONOKA_CONFIG_WORDSPREDICTION_ADDSAW,HONOKA_DEFAULT_WORDSPREDICTION_ADDSAW); + limit = cfg->read(HONOKA_CONFIG_WORDSPREDICTION_LIMIT,HONOKA_DEFAULT_WORDSPREDICTION_LIMIT); } @@ -71,11 +72,17 @@ prewords = str.substr(0,str.length() - word.length()); pos = prewords.length(); vector res = dic->find(utf8_wcstombs(word).c_str()); - l.Title = utf8_mbstowcs(String(_("lookup result"))); - l.kType = PREDICTION; - for(vector::iterator it = res.begin();it != res.end();it ++) { - if (addSpace) l.kouho.push_back(ResultEntry(prewords + utf8_mbstowcs(*it) + utf8_mbstowcs(" "),utf8_mbstowcs(*it))); - else l.kouho.push_back(ResultEntry(prewords + utf8_mbstowcs(*it),utf8_mbstowcs(*it))); + if (res.size() > limit) { + l.Title = utf8_mbstowcs(String(_("too many prediction results!"))); + l.kType = PREDICTION; + l.kouho.push_back(ResultEntry(str,word)); + } else { + l.Title = utf8_mbstowcs(String(_("lookup result"))); + l.kType = PREDICTION; + for(vector::iterator it = res.begin();it != res.end();it ++) { + if (addSpace) l.kouho.push_back(ResultEntry(prewords + utf8_mbstowcs(*it) + utf8_mbstowcs(" "),utf8_mbstowcs(*it))); + else l.kouho.push_back(ResultEntry(prewords + utf8_mbstowcs(*it),utf8_mbstowcs(*it))); + } } return l; } diff --git a/honoka/plugins/wordsprediction.h b/honoka/plugins/wordsprediction.h index 5b9b3f0..ab411cb 100644 --- a/honoka/plugins/wordsprediction.h +++ b/honoka/plugins/wordsprediction.h @@ -51,6 +51,7 @@ WordsDic *dic; int pos; bool addSpace; + int limit; }; } #endif diff --git a/honoka/po/honoka.pot b/honoka/po/honoka.pot index 3cf8a0f..708cdc3 100644 --- a/honoka/po/honoka.pot +++ b/honoka/po/honoka.pot @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-04 01:14+0900\n" +"POT-Creation-Date: 2006-02-04 15:05+0900\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -455,7 +455,7 @@ #: plugins/wnnplugin.cpp:78 plugins/anthyplugin.cpp:46 #: plugins/simpleprediction.cpp:53 plugins/primeprediction.cpp:71 #: plugins/skkdicconversion.cpp:53 plugins/cannaconversion.cpp:57 -#: plugins/asciiplugin.cpp:77 +#: plugins/asciiplugin.cpp:84 msgid "shortcut keys: " msgstr "" @@ -558,7 +558,7 @@ #: plugins/wnnconversion.cpp:412 plugins/anthyconversion.cpp:169 #: plugins/anthyprediction.cpp:60 plugins/simpleprediction.cpp:91 #: plugins/primeprediction.cpp:179 plugins/skkdicconversion.cpp:122 -#: plugins/cannaconversion.cpp:201 plugins/wordsprediction.cpp:74 +#: plugins/cannaconversion.cpp:201 plugins/wordsprediction.cpp:80 msgid "lookup result" msgstr "" @@ -737,35 +737,45 @@ msgstr "" #: plugins/asciiplugin.cpp:59 -msgid "Low priority key: " +msgid "_Limit of prediction results to display: " msgstr "" #: plugins/asciiplugin.cpp:61 +msgid "" +"set the getting limit of prediction results. it doesn't display the results " +"when the count of prediction results is more than this." +msgstr "" + +#: plugins/asciiplugin.cpp:66 +msgid "Low priority key: " +msgstr "" + +#: plugins/asciiplugin.cpp:68 msgid "set the key that lowers priority." msgstr "" -#: plugins/asciiplugin.cpp:65 +#: plugins/asciiplugin.cpp:72 msgid "Use automatic committing: " msgstr "" -#: plugins/asciiplugin.cpp:67 +#: plugins/asciiplugin.cpp:74 msgid "" "if you want to commit the string when you press the specific key,check it." msgstr "" -#: plugins/asciiplugin.cpp:71 +#: plugins/asciiplugin.cpp:78 msgid "Automatic committing key: " msgstr "" -#: plugins/asciiplugin.cpp:73 +#: plugins/asciiplugin.cpp:80 msgid "set the key that commit the string automatic." msgstr "" -#: plugins/asciiplugin.cpp:79 +#: plugins/asciiplugin.cpp:86 msgid "Ascii Input: " msgstr "" -#: plugins/asciiplugin.cpp:85 +#: plugins/asciiplugin.cpp:92 msgid "Words Prediction: " msgstr "" @@ -777,7 +787,11 @@ msgid "AsciiInput" msgstr "" -#: plugins/wordsprediction.cpp:116 +#: plugins/wordsprediction.cpp:76 +msgid "too many prediction results!" +msgstr "" + +#: plugins/wordsprediction.cpp:123 msgid "WordsPrediction" msgstr "" diff --git a/honoka/po/ja.po b/honoka/po/ja.po index 7e1c13a..1164c25 100644 --- a/honoka/po/ja.po +++ b/honoka/po/ja.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: ja\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-04 01:14+0900\n" +"POT-Creation-Date: 2006-02-04 15:05+0900\n" "PO-Revision-Date: 2004-12-01 14:29+0900\n" "Last-Translator: TAM (Teppei Tamra) \n" "Language-Team: Japanese\n" @@ -461,7 +461,7 @@ #: plugins/wnnplugin.cpp:78 plugins/anthyplugin.cpp:46 #: plugins/simpleprediction.cpp:53 plugins/primeprediction.cpp:71 #: plugins/skkdicconversion.cpp:53 plugins/cannaconversion.cpp:57 -#: plugins/asciiplugin.cpp:77 +#: plugins/asciiplugin.cpp:84 msgid "shortcut keys: " msgstr "ショートカットキー:" @@ -566,7 +566,7 @@ #: plugins/wnnconversion.cpp:412 plugins/anthyconversion.cpp:169 #: plugins/anthyprediction.cpp:60 plugins/simpleprediction.cpp:91 #: plugins/primeprediction.cpp:179 plugins/skkdicconversion.cpp:122 -#: plugins/cannaconversion.cpp:201 plugins/wordsprediction.cpp:74 +#: plugins/cannaconversion.cpp:201 plugins/wordsprediction.cpp:80 msgid "lookup result" msgstr "候補一覧" @@ -743,41 +743,53 @@ "At WordsPrediction, if you want to add a space after the committed word ," "check it." msgstr "" -"英単語予測において確定単語の後にスペースを追加させたい場合は" -"ここをチェックしてください。" +"英単語予測において確定単語の後にスペースを追加させたい場合はここをチェックし" +"てください。" #: plugins/asciiplugin.cpp:59 +msgid "_Limit of prediction results to display: " +msgstr "予測候補表示の限界" + +#: plugins/asciiplugin.cpp:61 +msgid "" +"set the getting limit of prediction results. it doesn't display the results " +"when the count of prediction results is more than this." +msgstr "" +"取得する予測結果の限度を設定してください。" +"これを越える数の予測結果の場合は表示しません。" + +#: plugins/asciiplugin.cpp:66 msgid "Low priority key: " msgstr "優先度を下げるキー:" -#: plugins/asciiplugin.cpp:61 +#: plugins/asciiplugin.cpp:68 msgid "set the key that lowers priority." msgstr "優先度を下げるキーを指定します。" -#: plugins/asciiplugin.cpp:65 +#: plugins/asciiplugin.cpp:72 msgid "Use automatic committing: " msgstr "自動確定を使う:" -#: plugins/asciiplugin.cpp:67 +#: plugins/asciiplugin.cpp:74 msgid "" "if you want to commit the string when you press the specific key,check it." msgstr "" "指定したキーが押された場合に自動的に確定したい場合はここをチェックして下さ" "い。" -#: plugins/asciiplugin.cpp:71 +#: plugins/asciiplugin.cpp:78 msgid "Automatic committing key: " msgstr "自動確定キー:" -#: plugins/asciiplugin.cpp:73 +#: plugins/asciiplugin.cpp:80 msgid "set the key that commit the string automatic." msgstr "自動確定を行うキーを指定します。" -#: plugins/asciiplugin.cpp:79 +#: plugins/asciiplugin.cpp:86 msgid "Ascii Input: " msgstr "英数字入力:" -#: plugins/asciiplugin.cpp:85 +#: plugins/asciiplugin.cpp:92 msgid "Words Prediction: " msgstr "英単語予測:" @@ -789,7 +801,11 @@ msgid "AsciiInput" msgstr "英数字入力" -#: plugins/wordsprediction.cpp:116 +#: plugins/wordsprediction.cpp:76 +msgid "too many prediction results!" +msgstr "候補多過ぎなので表示しません" + +#: plugins/wordsprediction.cpp:123 msgid "WordsPrediction" msgstr "英単語予測"