diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java index d22c6eb8832..23eaa1ea83e 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java @@ -161,7 +161,7 @@ public class Dictionary { private char[] ignore; String tryChars = ""; - String[] neighborKeyGroups = new String[0]; + String[] neighborKeyGroups = {"qwertyuiop", "asdfghjkl", "zxcvbnm"}; boolean enableSplitSuggestions = true; List repTable = new ArrayList<>(); List> mapTable = new ArrayList<>(); diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestSpellChecking.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestSpellChecking.java index 57adce60605..b13a2f842eb 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestSpellChecking.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestSpellChecking.java @@ -212,6 +212,10 @@ public class TestSpellChecking extends StemmerTestBase { doTest("nosuggest"); } + public void testUseUSKeyboardAsDefaultKeyValue() throws Exception { + doTest("keyDefault"); + } + protected void doTest(String name) throws Exception { checkSpellCheckerExpectations( Path.of(getClass().getResource(name + ".aff").toURI()).getParent().resolve(name)); diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.aff b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.aff new file mode 100644 index 00000000000..e69de29bb2d diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.dic b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.dic new file mode 100644 index 00000000000..6be6de1f74b --- /dev/null +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.dic @@ -0,0 +1,3 @@ +2 +gab +an \ No newline at end of file diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.sug b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.sug new file mode 100644 index 00000000000..ee17e06b23a --- /dev/null +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.sug @@ -0,0 +1 @@ +gab, an \ No newline at end of file diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.wrong b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.wrong new file mode 100644 index 00000000000..774b591bd5d --- /dev/null +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/keyDefault.wrong @@ -0,0 +1 @@ +gan \ No newline at end of file