When a dictionary entry contains spaces and KEEPCASE is used, Hunspell suggests words that are not valid according to the dictionary (they have the wrong capitalisation). Here is an example:
.dic file:
2
Foo bar/A
foo/A
.aff file:
KEEPCASE A
Test file:
Foo bar
Foo Bar
foo bar
foo Bar
FOO BAR
FOo BAr
foo
FOO
Result of running Hunspell on test file, using the attached script:
Foo bar OK
Foo Bar not OK. Suggestions: Foo Bar | Foo bar |
foo bar not OK. Suggestions: Foo bar |
foo Bar not OK. Suggestions: Foo Bar | Foo bar |
FOO BAR not OK. Suggestions: FOO BAR |
FOo BAr not OK. Suggestions: Foo Bar | Foo bar |
foo OK
FOO not OK. Suggestions: foo |
Expected results:
All suggestions from Hunspell should be contained in the dictionary (so that running Hunspell on the suggestion list should never mark a word as misspelled).
Perl script for returning Hunspell suggestions