added support for keys without letters
This commit is contained in:
parent
c844db1fa1
commit
afa509cee0
4 changed files with 4 additions and 3 deletions
|
|
@ -38,7 +38,7 @@ class LocaleWordsSorter {
|
||||||
|
|
||||||
|
|
||||||
ArrayList<String> sort(ArrayList<String> words) {
|
ArrayList<String> sort(ArrayList<String> words) {
|
||||||
if (sortingPattern == null || words == null) {
|
if (sortingPattern == null || words == null || words.isEmpty()) {
|
||||||
return words;
|
return words;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,7 @@ public class NaturalLanguage extends Language implements Comparable<NaturalLangu
|
||||||
private void generateCharacterKeyMap() {
|
private void generateCharacterKeyMap() {
|
||||||
characterKeyMap.clear();
|
characterKeyMap.clear();
|
||||||
for (int digit = 0; digit <= 9; digit++) {
|
for (int digit = 0; digit <= 9; digit++) {
|
||||||
|
characterKeyMap.put(getKeyNumber(digit).charAt(0), String.valueOf(digit));
|
||||||
for (String keyChar : getKeyCharacters(digit)) {
|
for (String keyChar : getKeyCharacters(digit)) {
|
||||||
characterKeyMap.put(keyChar.charAt(0), String.valueOf(digit));
|
characterKeyMap.put(keyChar.charAt(0), String.valueOf(digit));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public class SoftKeyNumber2to9 extends SoftKeyNumber {
|
||||||
displayChars = abbreviateCharList(displayChars, language.getLocale(), isUppercase);
|
displayChars = abbreviateCharList(displayChars, language.getLocale(), isUppercase);
|
||||||
}
|
}
|
||||||
|
|
||||||
return displayChars;
|
return displayChars.isEmpty() ? "--" : displayChars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ static def extractSoundFromLine(String line) {
|
||||||
|
|
||||||
|
|
||||||
static def isLayoutLine(String line) {
|
static def isLayoutLine(String line) {
|
||||||
return line.matches('\\s+- \\[.+?\\].*') && !line.find('\\d+]')
|
return line.matches('\\s+- \\[.*?\\].*') && !line.find('\\d+]')
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////// VALIDATION ////////////////////
|
//////////////////// VALIDATION ////////////////////
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue