1
0
Fork 0

dictionary reloading now resets the frequencies of the existing words to the factory default

This commit is contained in:
Dimo Karaivanov 2023-02-01 12:10:25 +02:00
parent f6c51d9304
commit f44cbae530
3 changed files with 6 additions and 6 deletions

View file

@ -153,8 +153,8 @@ public class DictionaryDb {
}
public static void insertWordsSync(List<Word> words) {
getInstance().wordsDao().insertMany(words);
public static void upsertWordsSync(List<Word> words) {
getInstance().wordsDao().upsertMany(words);
}

View file

@ -181,7 +181,7 @@ public class DictionaryLoader {
}
}
DictionaryDb.insertWordsSync(letters);
DictionaryDb.upsertWordsSync(letters);
}
@ -218,7 +218,7 @@ public class DictionaryLoader {
}
if (lineCount % settings.getDictionaryImportWordChunkSize() == 0 || lineCount == totalWords - 1) {
DictionaryDb.insertWordsSync(dbWords);
DictionaryDb.upsertWordsSync(dbWords);
dbWords.clear();
}

View file

@ -42,8 +42,8 @@ interface WordsDao {
@Insert
void insert(Word word);
@Insert(onConflict = OnConflictStrategy.IGNORE)
void insertMany(List<Word> words);
@Insert(onConflict = OnConflictStrategy.REPLACE)
void upsertMany(List<Word> words);
@Query(
"UPDATE words " +