dictionary reloading now resets the frequencies of the existing words to the factory default
This commit is contained in:
parent
f6c51d9304
commit
f44cbae530
3 changed files with 6 additions and 6 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 " +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue