| |
---|
| | } |
---|
| | if (!word.length()) return l; |
---|
| | prewords = str.substr(0,str.length() - word.length()); |
---|
| | pos = prewords.length(); |
---|
| | vector<string> res = dic->find(utf8_wcstombs(word).c_str()); |
---|
| | set<string> res = dic->find(utf8_wcstombs(word).c_str()); |
---|
| | if (res.size() > limit) { |
---|
| | l.Title = utf8_mbstowcs(String(_("too many prediction results!"))); |
---|
| | l.kType = PREDICTION; |
---|
| | l.kouho.push_back(ResultEntry(str,word)); |
---|
| |
---|
| | l.kouho.push_back(ResultEntry(str,word)); |
---|
| | } else { |
---|
| | l.Title = utf8_mbstowcs(String(_("lookup result"))); |
---|
| | l.kType = PREDICTION; |
---|
| | for(vector<string>::iterator it = res.begin();it != res.end();it ++) { |
---|
| | for(set<string>::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))); |
---|
| | } |
---|
| | } |
---|
| |
---|
| | |