regression: fixed word frequencies not updating
This commit is contained in:
parent
1a1222f069
commit
03d5145240
1 changed files with 5 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ import android.os.CancellationSignal;
|
||||||
import android.os.OperationCanceledException;
|
import android.os.OperationCanceledException;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
|
@ -120,14 +121,14 @@ public class ReadOps {
|
||||||
|
|
||||||
|
|
||||||
@NonNull
|
@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()) {
|
if (positions.isEmpty()) {
|
||||||
Logger.d(LOG_TAG, "No word positions. Not searching words.");
|
Logger.d(LOG_TAG, "No word positions. Not searching words.");
|
||||||
return new WordList();
|
return new WordList();
|
||||||
}
|
}
|
||||||
|
|
||||||
String wordsQuery = getWordsQuery(language, positions, filter, maximumWords, fullOutput);
|
String wordsQuery = getWordsQuery(language, positions, filter, maximumWords, fullOutput);
|
||||||
if (wordsQuery.isEmpty() || cancel.isCanceled()) {
|
if (wordsQuery.isEmpty() || (cancel != null && cancel.isCanceled())) {
|
||||||
return new WordList();
|
return new WordList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -161,8 +162,8 @@ public class ReadOps {
|
||||||
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public String getWordPositions(@NonNull SQLiteDatabase db, CancellationSignal cancel, @NonNull Language language, @NonNull String sequence, int generations, int minPositions, String wordFilter) {
|
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.isCanceled()) {
|
if (sequence.length() == 1 || (cancel != null && cancel.isCanceled())) {
|
||||||
return sequence;
|
return sequence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue