Huge speedup on ibus-table GUI repsond time when using a large phrases table. Currently, all the candidate phrases are created in the input panel before shown to the users, while only 6 of the candidates actually show up on the panel. For a phrase table with a lot of phrases, the candidate list can contain more than 3000 entries, especially when only the 1st key is entried. 3000 candidates will cause 3000 input widgets being generated before the first 6 candidates were show to the users. This can make the GUI update lagging up to a few seconds depending on the speed of the CPU. This is at least O(n). In this optimzed code, only 6 candidate widgets were generated at a time. More candidate widgets will be generate on next-page/previous- page action. Now we are O(1) for the GUI part of panel update.
…mpa-rhbz856903' into rel20121001
…ese-category-check-rhbz856320' into rel20121001
Currently there is a regular expression which filters out several lines defining valid phrases. The emoji-table for example has phrases containing spaces which are currently filtered out and the ipa-x-sampa table has trailing comments which are filtered out as well. In phrase_parser, the phrases are parsed like: xingma, phrase, freq = unicode (l, "utf-8").strip ().split ('\t')[:3] Therefore, it seems reasonable to change the regular expression checking for a table line containing a phrase definition to accept every line which has 3 columns seperated by tabs followed optionally by more columns also separated by tabs (the optional columns are ignored, i.e. they are just comments in the table source). See: https://bugzilla.redhat.com/show_bug.cgi?id=856903
The improvement is to ignore all non-Han characters when doing the check. This is to avoid classifying a simplified Chinese string as traditional just because it happens to include some non-Chinese characters, for example box drawing characters, which cannot be converted to gb2312 but happen to be convertible to big5hkscs. This fixes the problem in the emoji-table input method that most phrases cannot be input at all. See: https://bugzilla.redhat.com/show_bug.cgi?id=856320