errata-ai / Google

A Vale-compatible implementation of the Google Developer Documentation Style Guide.
MIT License
69 stars 23 forks source link

Google.Latin removes trailing comma when it shouldn't #18

Open ahus1 opened 2 years ago

ahus1 commented 2 years ago

When I have the following text in a Markdown file:

This is, e.g., some more dummy text.

Then Vale will suggest the following correction:

This is, for example some more dummy text.

Thereby removing the trailing comma which it shouldn't remove AFAIK and according to this page: https://english.stackexchange.com/questions/16172/should-i-always-use-a-comma-after-e-g-or-i-e

When going to the URL https://developers.google.com/style/abbreviations there are even some "for example" with a comma after them.

When using "e.g." without a trailing comma, it will remove the following blank:

This is, e.g. some more dummy text.

Then Vale will suggest the following correction:

This is, for examplesome more dummy text.

I talked to a friend, and he suggested a zero-width-lookahead instead, replacing [\s,] with ?=[\s,] in Google/Latin.yml

Once there is an agreement how the result should be, I'd be happy to provide a PR.