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
|
|
@ -4,7 +4,6 @@
|
|||
'll
|
||||
're
|
||||
've
|
||||
I
|
||||
abs 62
|
||||
cia 118
|
||||
co
|
||||
|
|
|
|||
|
Can't render this file because it is too large.
|
|
|
@ -1540,7 +1540,6 @@ Bélgica 116
|
|||
Bétera
|
||||
Bóntoc
|
||||
Búrbura
|
||||
C
|
||||
CD
|
||||
CFE
|
||||
CNDH
|
||||
|
|
@ -4020,7 +4019,6 @@ Fátima
|
|||
Félix 111
|
||||
Fómeque
|
||||
Fúquene
|
||||
G
|
||||
GPS
|
||||
Gabaldón
|
||||
Gaban
|
||||
|
|
@ -4858,7 +4856,6 @@ Huépil
|
|||
Hábita
|
||||
Héctor
|
||||
Héroes 118
|
||||
I
|
||||
IMSS 89
|
||||
INE 124
|
||||
INEGI 100
|
||||
|
|
@ -6829,7 +6826,6 @@ Múgica
|
|||
Múnera
|
||||
Mútis
|
||||
Múzquiz
|
||||
N
|
||||
NIF
|
||||
Naaguán
|
||||
Naborot
|
||||
|
|
@ -7106,7 +7102,6 @@ Nísperos 60
|
|||
Nóvita
|
||||
Núcleo 138
|
||||
Núñez
|
||||
O 184
|
||||
ONG
|
||||
ONU
|
||||
Oasis 101
|
||||
|
|
@ -7340,7 +7335,6 @@ Ozuluama
|
|||
Ozumba
|
||||
Ozámiz
|
||||
Oñate
|
||||
P
|
||||
PEMEX
|
||||
Pabellón 117
|
||||
Pabla
|
||||
|
|
@ -8519,7 +8513,6 @@ Quiñota
|
|||
Quíbor
|
||||
Quícharo
|
||||
Quípama
|
||||
R
|
||||
RAE 92
|
||||
Rabanedo
|
||||
Rabolargo
|
||||
|
|
@ -8804,7 +8797,6 @@ Rímac 80
|
|||
Río 159
|
||||
Ríos 139
|
||||
Rómulo
|
||||
S
|
||||
SAT
|
||||
SEDENA
|
||||
SEP
|
||||
|
|
@ -11117,7 +11109,6 @@ Yáñez
|
|||
Yécora
|
||||
Yésica
|
||||
Yólox
|
||||
Z
|
||||
Zaachila
|
||||
Zabache
|
||||
Zabaleta
|
||||
|
|
|
|||
|
Can't render this file because it is too large.
|
|
|
@ -131,7 +131,7 @@ static def validateDictionaryWord(String word, int lineNumber, String validChara
|
|||
errors += "${errorMsgPrefix}. Found a garbage word: '${word}' on line ${lineNumber}.\n"
|
||||
}
|
||||
|
||||
if (word.matches("^.\$") && !Character.isUpperCase(word.charAt(0))) {
|
||||
if (word.matches("^.\$")) {
|
||||
errorCount++
|
||||
errors += "${errorMsgPrefix}. Found a single letter: '${word}' on line ${lineNumber}. Only uppercase single letters are allowed. The rest of the alphabet will be added automatically.\n"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<string name="add_word_add">Add</string>
|
||||
<string name="add_word_blank">Blank word not added.</string>
|
||||
<string name="add_word_exist">Word \"%1$s\" already in the dictionary.</string>
|
||||
<string name="add_word_exist">Word \"%1$s\" is already in the dictionary.</string>
|
||||
<string name="add_word_invalid_language" translatable="false">Cannot add a word when no language is selected.</string>
|
||||
<string name="add_word_title">Add Word</string>
|
||||
<string name="add_word_field_placeholder">Type a word…</string>
|
||||
|
|
|
|||
|
|
@ -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