divvun / libdivvun

lib for running gramcheck and other pipelines + cli; modules for CG→spelling, CG→feedback, tagging blanks
https://giellalt.github.io/proof/gramcheck/GrammarCheckerDocumentation.html
GNU General Public License v3.0
9 stars 1 forks source link

Correction suggestions are lowercase when should have been uppercase #3

Closed snomos closed 5 years ago

snomos commented 6 years ago

See screenshot:

skjermbilde 2017-12-11 kl 07 16 33

This is a speller error, and as such it should follow the casing of the input word. But one can imagine that we want to detect and correct even casing errors, and I presently do not know how to make that work with the fix for this bug.

unhammer commented 6 years ago

In the cases where we explicitly want to correct casing, could we add a tag like <fixedcase> in CG to the correction, and if that tag is not there, we try to apply input casing?

So in the above example, there would be no <fixedcase> tag, and divvun-suggest would look at the word form and conclude that it's titlecased, and apply titlecasing to all suggestions.

But if you have the CG rule

"<Januar>"  COPY (&monthcasing &SUGGESTWF "<januar>" <fixedcase>) IF (NOT -1 CLB) …;

then because of the <fixedcase>, we wouldn't apply titlecasing to the suggestion.


On a related note, what about sillycasing (SlinCraze, iPhone)? Currently, this seems to work as it should (try iPhon ja slinCraze). I guess the automated input-casing would also have to avoid doing changes where the suggestion is not all lowercase, or where the only change between wordform and suggestion is in casing.

snomos commented 6 years ago

<fixedcase> seems like a working solution 👍

sillyCasing: agree with you. In general: lexical case should be preferred, whatever that is, and initial uppercase only applied to all-lowercase words (proper nouns are already uppercased, and sillyCased words should not be touched).

snomos commented 5 years ago

Any progress on this one? Using <fixedcase> seems fine, and other case handling types can be added later. Essentially, it should go like this:

Sounds ok?

unhammer commented 5 years ago

This goes not just for spelling, but for stuff added with &SUGGEST too, right?

snomos commented 5 years ago

yes