mirror of
https://github.com/apache/lucene.git
synced 2025-02-28 21:39:25 +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);
|
||||
if (dictionary.forceUCase != FLAG_UNSET && wordCase == WordCase.LOWER) {
|
||||
String title = dictionary.toTitleCase(word);
|
||||
if (spell(title)) {
|
||||
return Collections.singletonList(title);
|
||||
}
|
||||
}
|
||||
|
||||
SpellChecker suggestionSpeller =
|
||||
new SpellChecker(dictionary) {
|
||||
@Override
|
||||
|
@ -0,0 +1,2 @@
|
||||
Foobaz
|
||||
Foobarbaz
|
Loading…
x
Reference in New Issue
Block a user