errata-ai / Microsoft

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

Ordinal Date false capture bug #25

Closed brandonkal closed 5 years ago

brandonkal commented 5 years ago

This regex marks the word "of" as an ordinal number. There may be other cases.

May of 2013

Results in the error: Don't use ordinal numbers for dates

https://github.com/errata-ai/Microsoft/blob/00eeb71180c72e6e85faeca0434eaaa861e805b4/Microsoft/DateNumbers.yml#L7

amyq commented 5 years ago

@esmerel and I have hit this bug too.

jdkato commented 5 years ago

The best solution here is probably to just go through and enumerate the first 31 ordinal numbers. I'd probably use a rule structure similar to Passive to avoid having one long line.