languagetool-org / languagetool

Style and Grammar Checker for 25+ Languages
https://languagetool.org
GNU Lesser General Public License v2.1
12.27k stars 1.38k forks source link

[en] wrong suggestion for METRIC_UNITS_EN_US #2170

Open tiff opened 4 years ago

tiff commented 4 years ago

enabling acceleration from 0-60 mph in as little as 2.9 seconds and up to 500 miles of range.

It should ignore the "-"

Bildschirmfoto 2019-11-22 um 07 12 32

MikeUnwalla commented 4 years ago

As an alternative to ignoring the hyphen, the rule could include the first number in the range.

tiff commented 4 years ago

@fabrichter can you take care? I'm fine with both solutions

fabrichter commented 4 years ago

Got a quick fix ready so that the number is not parsed as negative anymore, though the hyphen is still included in the first part of the suggestion with the original text (see [1]). To handle these cases properly (i.e. convert the complete range & don't have a bit confusing match positions and suggestions) I would want to do more refactoring, that will have to wait for a later time I'm afraid.

[1]:

image Applying the correction results in:

Enabling acceleration from 0-60 mph (ca. 97 km/h) in as little as 2.9 seconds.

danielnaber commented 3 years ago

Now fixed by ignoring these cases. Interpreting "x-y" as a range would be even nicer, though. Leaving this issue open for the future for that.