From bf9d1a8c785659c92cad69de1dc5497f15c8b5cc Mon Sep 17 00:00:00 2001 From: sspanak Date: Thu, 19 Dec 2024 11:15:07 +0200 Subject: [PATCH] fixed the word frequencies not updating when filtering is on --- .../sspanak/tt9/ime/modes/predictions/WordPredictions.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/github/sspanak/tt9/ime/modes/predictions/WordPredictions.java b/app/src/main/java/io/github/sspanak/tt9/ime/modes/predictions/WordPredictions.java index b872fec9..769958cf 100644 --- a/app/src/main/java/io/github/sspanak/tt9/ime/modes/predictions/WordPredictions.java +++ b/app/src/main/java/io/github/sspanak/tt9/ime/modes/predictions/WordPredictions.java @@ -254,8 +254,10 @@ public class WordPredictions extends Predictions { if ( word == null // If the word is the first suggestion, we have already guessed it right, and it makes no - // sense to store it as a popular pair or increase its priority. - || (!words.isEmpty() && words.get(0).equals(word)) + // sense to store it as a popular pair or increase its priority. However, if the stem has been + // set using word filtering, the user has probably tried to search for a word that has not been + // displayed at the beginning. In this case, we process it after all. + || (!words.isEmpty() && words.get(0).equals(word) && stem.isEmpty()) ) { return; }