LUCENE-9784: Hunspell suggestions: use US keyboard in absence of KEY option (#2389)

This commit is contained in:
Peter Gromov 2021-02-18 09:26:22 +01:00 committed by GitHub
parent 4bd4f7063b
commit f83c9862e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 1 deletions

View File

@ -161,7 +161,7 @@ public class Dictionary {
private char[] ignore; private char[] ignore;
String tryChars = ""; String tryChars = "";
String[] neighborKeyGroups = new String[0]; String[] neighborKeyGroups = {"qwertyuiop", "asdfghjkl", "zxcvbnm"};
boolean enableSplitSuggestions = true; boolean enableSplitSuggestions = true;
List<RepEntry> repTable = new ArrayList<>(); List<RepEntry> repTable = new ArrayList<>();
List<List<String>> mapTable = new ArrayList<>(); List<List<String>> mapTable = new ArrayList<>();

View File

@ -212,6 +212,10 @@ public class TestSpellChecking extends StemmerTestBase {
doTest("nosuggest"); doTest("nosuggest");
} }
public void testUseUSKeyboardAsDefaultKeyValue() throws Exception {
doTest("keyDefault");
}
protected void doTest(String name) throws Exception { protected void doTest(String name) throws Exception {
checkSpellCheckerExpectations( checkSpellCheckerExpectations(
Path.of(getClass().getResource(name + ".aff").toURI()).getParent().resolve(name)); Path.of(getClass().getResource(name + ".aff").toURI()).getParent().resolve(name));