You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<rule id="CASE_CONVERSION_TEST" name="Case conversion test">
<pattern>
<token>cat</token>
</pattern>
<message>Use '<suggestion>dog</suggestion>'.</message>
<example correction="dog">My <marker>cat</marker> is happy.</example>
<example correction="Dog">My <marker>Cat</marker> is fat.</example>
<example correction="DOG">MY <marker>CAT</marker> SAT ON THE MAT.</example>
</rule>
Testrules gives this message (LanguageTool-20220919-snapshot.zip):
Exception in thread "main" org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure: Test failure for rule CASE_CONVERSION_TEST[1] in file /org/languagetool/rules/en/grammar.xml: Incorrect suggestions: Expected 'DOG', got: 'Dog' on input: 'MY CAT SAT ON THE MAT.'
The text was updated successfully, but these errors were encountered:
You are right. The default behaviour of the suggestions should be similar to case_converson="preserve" for all languages. I will take a look. Probably, we will need to adjust some tests in many languages.
Once we preserve the case for all-uppercase words in the original sentence automatically, rule creators will need a way to make exceptions to all-uppercase suggestions. The way to do that, is to use a <match> with a case_conversion attribute:
"Note: LT automatically adjusts the case of suggestions if they are added as plain text." (https://dev.languagetool.org/tips-and-tricks#changing-the-case-of-matched-word)
Testrules gives this message (LanguageTool-20220919-snapshot.zip):
Exception in thread "main" org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure: Test failure for rule CASE_CONVERSION_TEST[1] in file /org/languagetool/rules/en/grammar.xml: Incorrect suggestions: Expected 'DOG', got: 'Dog' on input: 'MY CAT SAT ON THE MAT.'
The text was updated successfully, but these errors were encountered: