regression: impossible to update the frequencies of words with apostrophes
This commit is contained in:
parent
267b3f6270
commit
00e00e1802
1 changed files with 9 additions and 4 deletions
|
|
@ -17,6 +17,7 @@ import io.github.sspanak.tt9.languages.exceptions.InvalidLanguageCharactersExcep
|
||||||
import io.github.sspanak.tt9.preferences.settings.SettingsStore;
|
import io.github.sspanak.tt9.preferences.settings.SettingsStore;
|
||||||
import io.github.sspanak.tt9.util.Logger;
|
import io.github.sspanak.tt9.util.Logger;
|
||||||
import io.github.sspanak.tt9.util.Text;
|
import io.github.sspanak.tt9.util.Text;
|
||||||
|
import io.github.sspanak.tt9.util.TextTools;
|
||||||
|
|
||||||
class ModeWords extends ModeCheonjiin {
|
class ModeWords extends ModeCheonjiin {
|
||||||
private final String LOG_TAG = getClass().getSimpleName();
|
private final String LOG_TAG = getClass().getSimpleName();
|
||||||
|
|
@ -311,15 +312,19 @@ class ModeWords extends ModeCheonjiin {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// emojis and special chars are not in the database, so there is no point in wasting resources
|
if (TextTools.isGraphic(currentWord) || new Text(currentWord).isNumeric()) {
|
||||||
// running queries on them
|
|
||||||
if (!new Text(currentWord).isAlphabetic()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// special chars are not in the database, no need to run queries on them
|
||||||
|
String digitSequence = language.getDigitSequenceForWord(currentWord);
|
||||||
|
if (digitSequence.equals(SPECIAL_CHAR_SEQUENCE) || digitSequence.equals(PUNCTUATION_SEQUENCE)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// increment the frequency of the given word
|
// increment the frequency of the given word
|
||||||
predictions.onAccept(currentWord, language.getDigitSequenceForWord(currentWord));
|
predictions.onAccept(currentWord, digitSequence);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.e(LOG_TAG, "Failed incrementing priority of word: '" + currentWord + "'. " + e.getMessage());
|
Logger.e(LOG_TAG, "Failed incrementing priority of word: '" + currentWord + "'. " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue