Skip to content

Commit

Permalink
regression: fixed word frequencies not updating
Browse files Browse the repository at this point in the history
  • Loading branch information
sspanak committed Oct 30, 2024
1 parent 1a1222f commit 03d5145
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.os.OperationCanceledException;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.ArrayList;

Expand Down Expand Up @@ -120,14 +121,14 @@ public String getWords(@NonNull SQLiteDatabase db, Language language, boolean cu


@NonNull
public WordList getWords(@NonNull SQLiteDatabase db, CancellationSignal cancel, @NonNull Language language, @NonNull String positions, String filter, int maximumWords, boolean fullOutput) {
public WordList getWords(@NonNull SQLiteDatabase db, @Nullable CancellationSignal cancel, @NonNull Language language, @NonNull String positions, String filter, int maximumWords, boolean fullOutput) {
if (positions.isEmpty()) {
Logger.d(LOG_TAG, "No word positions. Not searching words.");
return new WordList();
}

String wordsQuery = getWordsQuery(language, positions, filter, maximumWords, fullOutput);
if (wordsQuery.isEmpty() || cancel.isCanceled()) {
if (wordsQuery.isEmpty() || (cancel != null && cancel.isCanceled())) {
return new WordList();
}

Expand Down Expand Up @@ -161,8 +162,8 @@ public String getSimilarWordPositions(@NonNull SQLiteDatabase db, @NonNull Cance


@NonNull
public String getWordPositions(@NonNull SQLiteDatabase db, CancellationSignal cancel, @NonNull Language language, @NonNull String sequence, int generations, int minPositions, String wordFilter) {
if (sequence.length() == 1 || cancel.isCanceled()) {
public String getWordPositions(@NonNull SQLiteDatabase db, @Nullable CancellationSignal cancel, @NonNull Language language, @NonNull String sequence, int generations, int minPositions, String wordFilter) {
if (sequence.length() == 1 || (cancel != null && cancel.isCanceled())) {
return sequence;
}

Expand Down

0 comments on commit 03d5145

Please sign in to comment.