mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix 2306814: Too aggressive suggesting names from my contacts list.
When there is more than one instance of a name in the Contacts, it gets a very high weightage and can override corrections for very high frequency words such as "the". This fix prevents multiple occurences from increasing the frequency of a contact and also from bumping it above 255, which is the frequency of "the", "is", etc.
This commit is contained in:
parent
bb6f9146f1
commit
5b63c38d1f
@ -105,8 +105,8 @@ public class ExpandableDictionary extends Dictionary {
|
||||
if (wordLength == depth + 1) {
|
||||
// Terminate this word
|
||||
childNode.terminal = true;
|
||||
childNode.frequency += frequency; // If there are multiple similar words
|
||||
if (childNode.frequency > 256) childNode.frequency = 256;
|
||||
childNode.frequency = Math.max(frequency, childNode.frequency);
|
||||
if (childNode.frequency > 255) childNode.frequency = 255;
|
||||
return;
|
||||
}
|
||||
if (childNode.children == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user