-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting up a option (switch) to always show single character as preferred candidates before phrases. #107
Comments
At the moment, ibus-table has an option in the setup tool to choose Compose: [Phrase|Single Char] If this is set to “Single Char”, only single characters ans no phrases are shown. But if it is set to “Phrase”, then a mixture of single characters and phrases may be shown. For example like this: (Here I have increased the "debug level" in the ibus-table setup tool to show the priorities from the system database and the user database which are shown in green, the first column is the priority from the system database, the second is the priority from the user database, i.e. the number oftimes the user has typed this phrase/character) |
The sorting of this candidate list is currently done like this: https://github.com/mike-fabian/ibus-table/blob/master/engine/tabsqlitedb.py#L1018
|
So exact matches come first, then it is sorted by user frequency, then by system frequency, then by the lengths of the input string needed to type these characters, then by the input string alphabetical and finally by the code points as fallbacks. I.e. in this example:
comes first because it is an exact match for the typed input
Now 你好
has a lower system frequency (70500000) then 你 (1490000000) but 你好 has a higher user frequency (4) than 你 (3) so 你好 comes above 你 (when the dynamic adjust option is used which is the default for wubi-jidian).
你 and 全国 both have the user frequency 4 and but the system frequency of 你 (1490000000) is higher so 你 comes before 全国. And then 倆 has a user frequency (1) so it comes after the candidates
And finally 𥝈 with system frequency 0 and user frequency 0:
|
Now I could make a change like this for example:
I checked what happend when inserting this But inserting this This is what I did in the above experimental patch. It would not change the order in the above screenshot though because the two character phrases 你好 and 全国 would still get the same position because of their higher user frequency, i.e. one would still get:
But lets say the user frequencies are all the same (or the dynamic adjust option is off which means user frequencies are not used), then my experimental patch above gives this order when using the “Simplified Chinese first” option:
(倆 comes after 𥝈 inspite of its higher system frequency because 倆 is marked as a character used only in Traditional Chinese and 𥝈 is not marked at all so it is assumed that it is for all variants of Chinese:
When using “Tradional Chinese first” one would get:
Now 你好 would come before 全国 inspite of its lower system frequency because 国 is marked as a character only used in simplified Chinese:
|
In my experimental patch above, I inserted the If this behaviour is useful, I could add an option like
To enable this behaviour when this option is checked. Is that what you want? Would that be useful? |
Ping 🏓 |
See first comment of #103:
The text was updated successfully, but these errors were encountered: