errata-ai / Microsoft

A Vale-compatible implementation of the Microsoft Writing Style Guide.
https://github.com/errata-ai/vale
MIT License
84 stars 46 forks source link

Oxford comma mistakenly suggested #20

Open felicitymay opened 5 years ago

felicitymay commented 5 years ago

Sometimes, Vale suggests an Oxford comma when it isn't needed. For an example, see: https://gist.github.com/felicity-semmle/05e45ca77f168865819e70c47d7eee69.

I've tried rewording this to reduce the chances that Vale will flag it (previously it started: "In this case,") but that didn't work. I'm not sure that it's going to be possible to remove this false positive result, but thought I'd ask just in case. Feel free to close this if it's just not possible.

jdkato commented 5 years ago

Hmm -- I'm not sure.

It's possible we could employ some pattern-based heuristic, but it's not immediately clear to me what that might be. I've created a Regex101 test suite, if anyone wants to play around with the pattern.

That said, if you'd like to exclude these false positives without disabling the rule altogether, you can use an in-document comment.

aireilly commented 1 year ago

Note the Oxford comma rule in the referenced commit above only catches errors at the end of the sentence. See https://github.com/redhat-documentation/vale-at-red-hat/pull/569/files#diff-4d1c06a8fa11acc150e3e25b3ba89b4438b7650bbccd180de752d8aacfb0534fR8

https://regex101.com/r/Qav0Jg/1

aireilly commented 1 year ago

Updated in https://github.com/errata-ai/Microsoft/pull/53