Skip to content

Commit

Permalink
fix(rule): add word boundary for circa and ergo
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Sep 5, 2024
1 parent 01eb17e commit dc1250c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Prim/Latin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ nonword: true
action:
name: replace
swap:
circa: around|about
\bcirca\b: around|about
'\b(?:eg|e\.g\.)[\s,]': for example
ergo: therefore
\bergo\b: therefore
'\bet al\.': and others
'\betc\.': and other(s)
'\b(?:ie|i\.e\.)[\s,]': that is
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prim",
"version": "0.0.10",
"version": "0.0.11",
"description": "A Vale-compatible prose style for non-native English speaker",
"type": "module",
"author": "Naiyer Asif (https://naiyerasif.com)",
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/Latin/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

<!-- circa -->
He was born circa 1600.
The circadian rhythm regulates sleep and wakefulness.

<!-- e.g. -->
The rocky planets (e.g., Mercury) are closest to our sun.
Farmer Brown sells his produce (eg, apples, oranges, carrots) at the market.

<!-- ergo -->
The products are poorly constructed; ergo, they break easily.
The ergonomic mouse reduces hand strain.

<!-- et al. -->
Taylor et al., 2018
Expand Down
22 changes: 11 additions & 11 deletions test/snapshots/Latin.log
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
test.md:4:13:Prim.Latin:Avoid latin. Use 'around' or 'about' instead of 'circa'.
test.md:7:20:Prim.Latin:Avoid latin. Use 'for example' instead of 'e.g.,'.
test.md:8:33:Prim.Latin:Avoid latin. Use 'for example' instead of 'eg,'.
test.md:11:38:Prim.Latin:Avoid latin. Use 'therefore' instead of 'ergo'.
test.md:14:8:Prim.Latin:Avoid latin. Use 'and others' instead of 'et al.'.
test.md:17:38:Prim.Latin:Avoid latin. Use 'and other(s)' instead of 'etc.'.
test.md:20:20:Prim.Latin:Avoid latin. Use 'that is' instead of 'i.e.,'.
test.md:21:33:Prim.Latin:Avoid latin. Use 'that is' instead of 'ie,'.
test.md:24:22:Prim.Latin:Avoid latin. Use 'against' instead of 'vs.'.
test.md:27:26:Prim.Latin:Avoid latin. Use 'against' instead of 'versus'.
test.md:30:33:Prim.Latin:Avoid latin. Use 'over' or 'through' instead of 'via'.
test.md:34:31:Prim.Latin:Avoid latin. Use 'namely' instead of 'viz.'.
test.md:8:20:Prim.Latin:Avoid latin. Use 'for example' instead of 'e.g.,'.
test.md:9:33:Prim.Latin:Avoid latin. Use 'for example' instead of 'eg,'.
test.md:12:38:Prim.Latin:Avoid latin. Use 'therefore' instead of 'ergo'.
test.md:16:8:Prim.Latin:Avoid latin. Use 'and others' instead of 'et al.'.
test.md:19:38:Prim.Latin:Avoid latin. Use 'and other(s)' instead of 'etc.'.
test.md:22:20:Prim.Latin:Avoid latin. Use 'that is' instead of 'i.e.,'.
test.md:23:33:Prim.Latin:Avoid latin. Use 'that is' instead of 'ie,'.
test.md:26:22:Prim.Latin:Avoid latin. Use 'against' instead of 'vs.'.
test.md:29:26:Prim.Latin:Avoid latin. Use 'against' instead of 'versus'.
test.md:32:33:Prim.Latin:Avoid latin. Use 'over' or 'through' instead of 'via'.
test.md:36:31:Prim.Latin:Avoid latin. Use 'namely' instead of 'viz.'.

0 comments on commit dc1250c

Please sign in to comment.