Skip to content

Commit

Permalink
fixed the word frequencies not updating when filtering is on
Browse files Browse the repository at this point in the history
  • Loading branch information
sspanak committed Dec 21, 2024
1 parent 19fa3dc commit bf9d1a8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ public void onAccept(String word, String sequence) {
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;
}
Expand Down

0 comments on commit bf9d1a8

Please sign in to comment.