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) {
|
public static void upsertWordsSync(List<Word> words) {
|
||||||
getInstance().wordsDao().insertMany(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) {
|
if (lineCount % settings.getDictionaryImportWordChunkSize() == 0 || lineCount == totalWords - 1) {
|
||||||
DictionaryDb.insertWordsSync(dbWords);
|
DictionaryDb.upsertWordsSync(dbWords);
|
||||||
dbWords.clear();
|
dbWords.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,8 @@ interface WordsDao {
|
||||||
@Insert
|
@Insert
|
||||||
void insert(Word word);
|
void insert(Word word);
|
||||||
|
|
||||||
@Insert(onConflict = OnConflictStrategy.IGNORE)
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||||
void insertMany(List<Word> words);
|
void upsertMany(List<Word> words);
|
||||||
|
|
||||||
@Query(
|
@Query(
|
||||||
"UPDATE words " +
|
"UPDATE words " +
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue