mirror of
https://github.com/apache/lucene.git
synced 2025-03-01 05:49:33 +00:00
LUCENE-9764: Hunspell: try title case as FORCEUCASE misspelled word suggestions (#2352)
This commit is contained in:
parent
7f9b1f991b
commit
01e34f8723
@ -430,6 +430,13 @@ public class SpellChecker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
WordCase wordCase = WordCase.caseOf(word);
|
WordCase wordCase = WordCase.caseOf(word);
|
||||||
|
if (dictionary.forceUCase != FLAG_UNSET && wordCase == WordCase.LOWER) {
|
||||||
|
String title = dictionary.toTitleCase(word);
|
||||||
|
if (spell(title)) {
|
||||||
|
return Collections.singletonList(title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SpellChecker suggestionSpeller =
|
SpellChecker suggestionSpeller =
|
||||||
new SpellChecker(dictionary) {
|
new SpellChecker(dictionary) {
|
||||||
@Override
|
@Override
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
Foobaz
|
||||||
|
Foobarbaz
|
Loading…
x
Reference in New Issue
Block a user