-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
132 additions
and
156 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# -*- coding: utf-8 -*- | ||
"""MAU102: Preferred forms, needless variants. | ||
--- | ||
layout: post | ||
error_code: MAU102 | ||
source: Garner's Modern American Usage | ||
source_url: http://amzn.to/15wF76r | ||
title: abbetor | ||
date: 2014-06-10 12:31:19 | ||
categories: writing | ||
--- | ||
Points out use of needless variants and less preferred forms. | ||
""" | ||
import re | ||
|
||
|
||
def check(text): | ||
"""Suggest the preferred forms.""" | ||
err = "MAU102" | ||
msg = "{} is the preferred form." | ||
|
||
preferences = [ | ||
|
||
# Needless variants | ||
["abbreviable", ["abbreviatable"]], | ||
["abolition", ["abolishment"]], | ||
["accessory", ["accessary"]], | ||
["accrual", ["accruement"]], | ||
["accumulate", ["cumulate"]], | ||
["accused", ["accusee"]], | ||
["acquaintance", ["acquaintanceship"]], | ||
["acquittal", ["acquitment"]], | ||
["administer", ["administrate"]], | ||
["administered", ["administrated"]], | ||
["administering", ["administrating"]], | ||
["adulterous", ["adulterate"]], | ||
["advisory", ["advisatory"]], | ||
["advocate", ["advocator"]], | ||
["alleger", ["allegator"]], | ||
["allusive", ["allusory"]], | ||
["ameliorate", ["meliorate"]], | ||
["amorous", ["amative"]], | ||
["amortization", ["amortizement"]], | ||
["amphibology", ["amphiboly"]], | ||
["anachronism", ["parachronism"]], | ||
["anecdotist", ["anecdotalist"]], | ||
["anilingus", ["anilinctus"]], | ||
["anticipatory", ["anticipative"]], | ||
["convertible", ["conversible"]], | ||
["neglectful", ["neglective"]], | ||
["transposition", ["transposal"]], | ||
|
||
# Misc. misspellings | ||
["academically", ["academicly"]], | ||
["anilingus", ["analingus"]], | ||
|
||
# Hyphenated words | ||
["tortfeasor", ["tort feasor", "tort-feasor"]], | ||
["transship", ["tranship", "trans-ship"]], | ||
["transshipped", ["transhipped", "trans-shipped"]], | ||
["transshipping", ["transhipping", "trans-shipping"]], | ||
|
||
# able vs. ible | ||
["addable", ["addible"]], | ||
["adducible", ["adduceable"]], | ||
|
||
# er vs. or | ||
["abettor", ["abbeter"]], | ||
["acquirer", ["acquiror"]], | ||
|
||
# TODO, entries that are a bit complicated | ||
# announce | ||
] | ||
errors = [] | ||
for p in preferences: | ||
for r in p[1]: | ||
for m in re.finditer(r, text, flags=re.IGNORECASE): | ||
errors.append((m.start(), m.end(), err, msg.format(p[0]))) | ||
|
||
return errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
"""MAU103: Redundancy. | ||
--- | ||
layout: post | ||
error_code: MAU103 | ||
source: Garner's Modern American Usage | ||
source_url: http://amzn.to/15wF76r | ||
title: abbetor | ||
date: 2014-06-10 12:31:19 | ||
categories: writing | ||
--- | ||
Points out use redundant phrases. | ||
""" | ||
import re | ||
|
||
|
||
def check(text): | ||
"""Suggest the preferred forms.""" | ||
err = "MAU103" | ||
msg = "'{}' is redundant, try '{}'." | ||
|
||
redundancies = [ | ||
["antithetical", ["directly antithetical"]], | ||
["ATM", ["ATM machine"]], | ||
["approximately", ["approximately about"]], | ||
["associate", ["associate together"]], | ||
["associate", ["associate together in groups"]], | ||
["vocation", ["professional vocation"]], | ||
["bivouac", ["temporary bivouac", "bivouac camp"]], | ||
["obvious", ["blatantly obvious"]], | ||
["but", ["but nevertheless"]], | ||
["charged with ...", ["accused of a charge"]], | ||
["circumstances", ["surrounding circumstances"]], | ||
["circumstances of", ["circumstances surrounding"]], | ||
["close", ["close proximity"]], | ||
["collaborator", ["fellow collaborator"]], | ||
["collaborators", ["fellow collaborators"]] | ||
] | ||
|
||
errors = [] | ||
for p in redundancies: | ||
for r in p[1]: | ||
for m in re.finditer(r, text, flags=re.IGNORECASE): | ||
errors.append((m.start(), m.end(), err, msg.format(r, p[0]))) | ||
|
||
return errors |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters