You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2021/02/18 08:26:43 UTC
[lucene-solr] branch master updated: LUCENE-9784: Hunspell
suggestions: use US keyboard in absence of KEY option (#2389)
This is an automated email from the ASF dual-hosted git repository.
dweiss pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/master by this push:
new f83c986 LUCENE-9784: Hunspell suggestions: use US keyboard in absence of KEY option (#2389)
f83c986 is described below
commit f83c9862e8412e9cbcf3a9af10cf74887dff852f
Author: Peter Gromov <pe...@jetbrains.com>
AuthorDate: Thu Feb 18 09:26:22 2021 +0100
LUCENE-9784: Hunspell suggestions: use US keyboard in absence of KEY option (#2389)
---
.../src/java/org/apache/lucene/analysis/hunspell/Dictionary.java | 2 +-
.../test/org/apache/lucene/analysis/hunspell/TestSpellChecking.java | 4 ++++
.../src/test/org/apache/lucene/analysis/hunspell/keyDefault.aff | 0
.../src/test/org/apache/lucene/analysis/hunspell/keyDefault.dic | 3 +++
.../src/test/org/apache/lucene/analysis/hunspell/keyDefault.sug | 1 +
.../src/test/org/apache/lucene/analysis/hunspell/keyDefault.wrong | 1 +
6 files changed, 10 insertions(+), 1 deletion(-)
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 d22c6eb..23eaa1e 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<RepEntry> repTable = new ArrayList<>();
List<List<String>> 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 57adce6..b13a2f8 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 0000000..e69de29
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 0000000..6be6de1
--- /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 0000000..ee17e06
--- /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 0000000..774b591
--- /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