mirror of https://github.com/apache/lucene.git
LUCENE-9772: Hunspell: CHECKCOMPOUNDCASE shouldn't prohibit dash-separated uppercase compounds (#2370)
This commit is contained in:
parent
b20e277569
commit
1ff11dd02c
|
@ -336,7 +336,9 @@ public class Hunspell {
|
||||||
|
|
||||||
private boolean mayBreakIntoCompounds(char[] chars, int offset, int length, int breakPos) {
|
private boolean mayBreakIntoCompounds(char[] chars, int offset, int length, int breakPos) {
|
||||||
if (dictionary.checkCompoundCase) {
|
if (dictionary.checkCompoundCase) {
|
||||||
if (Character.isUpperCase(chars[breakPos - 1]) || Character.isUpperCase(chars[breakPos])) {
|
char a = chars[breakPos - 1];
|
||||||
|
char b = chars[breakPos];
|
||||||
|
if ((Character.isUpperCase(a) || Character.isUpperCase(b)) && a != '-' && b != '-') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
# forbid upper case letters at word bounds in compounding
|
# forbid upper case letters at word bounds in compounding
|
||||||
CHECKCOMPOUNDCASE
|
CHECKCOMPOUNDCASE
|
||||||
|
WORDCHARS -
|
||||||
COMPOUNDFLAG A
|
COMPOUNDFLAG A
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
4
|
5
|
||||||
foo/A
|
foo/A
|
||||||
Bar/A
|
Bar/A
|
||||||
BAZ/A
|
BAZ/A
|
||||||
-/A
|
-/A
|
||||||
|
prefix-/A
|
|
@ -3,3 +3,4 @@ foo-Bar
|
||||||
foo-BAZ
|
foo-BAZ
|
||||||
BAZ-foo
|
BAZ-foo
|
||||||
BAZ-Bar
|
BAZ-Bar
|
||||||
|
prefix-BAZ
|
Loading…
Reference in New Issue