removed the capital letter hack and added a new one, only for the English I, in DictionaryLoader
removed some unused code and fixed a spelling mistake
This commit is contained in:
parent
dc0468ffeb
commit
17e9b779e6
6 changed files with 6 additions and 24 deletions
|
|
@ -101,15 +101,6 @@ public class DictionaryDb {
|
|||
}
|
||||
|
||||
|
||||
public static boolean doesWordExistSync(Language language, String word) {
|
||||
if (language == null || word == null || word.equals("")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return getInstance().wordsDao().doesWordExist(language.getId(), word) > 0;
|
||||
}
|
||||
|
||||
|
||||
public static void deleteWords(Runnable notification) {
|
||||
deleteWords(notification, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import java.io.InputStreamReader;
|
|||
import java.io.LineNumberReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
import io.github.sspanak.tt9.ConsumerCompat;
|
||||
import io.github.sspanak.tt9.Logger;
|
||||
|
|
@ -168,11 +169,11 @@ public class DictionaryLoader {
|
|||
private void importLetters(Language language) {
|
||||
ArrayList<Word> letters = new ArrayList<>();
|
||||
|
||||
boolean isEnglish = language.getLocale().equals(Locale.ENGLISH);
|
||||
|
||||
for (int key = 2; key <= 9; key++) {
|
||||
for (String langChar : language.getKeyCharacters(key, false)) {
|
||||
if (DictionaryDb.doesWordExistSync(language, langChar.toUpperCase(language.getLocale()))) {
|
||||
continue;
|
||||
}
|
||||
langChar = (isEnglish && langChar.equals("i")) ? langChar.toUpperCase(Locale.ENGLISH) : langChar;
|
||||
|
||||
Word word = new Word();
|
||||
word.langId = language.getId();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue