diff --git a/proselint/checks/mau_abbetor.py b/proselint/checks/mau_abbetor.py deleted file mode 100644 index ddf8fd95a..000000000 --- a/proselint/checks/mau_abbetor.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -"""MAU102: Preferred spelling is 'abbetor'. - ---- -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 ---- - -In both AmE and BrE, abettor is the more usual spelling. - -""" -from proselint.tools import supersede - -check = supersede("abbetor", "abbeter", "MAU102") diff --git a/proselint/checks/mau_abbreviable.py b/proselint/checks/mau_abbreviable.py deleted file mode 100644 index 887070bfc..000000000 --- a/proselint/checks/mau_abbreviable.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -"""MAU101: Misspelling of 'abbreviable'. - ---- -layout: post -error_code: MAU101 -source: Garner's Modern American Usage -source_url: http://amzn.to/15wF76r -title: abbreviable -date: 2014-06-10 12:31:19 -categories: writing ---- - -It's abbreviable, not abbreviatable. - -""" -from proselint.tools import supersede - -check = supersede("abbreviable", "abbreviatable", "MAU101") diff --git a/proselint/checks/mau_academically.py b/proselint/checks/mau_academically.py deleted file mode 100644 index f803270ed..000000000 --- a/proselint/checks/mau_academically.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -"""MAU102: Misspelling of 'academically'. - ---- -layout: post -error_code: MAU103 -source: Garner's Modern American Usage -source_url: http://amzn.to/15wF76r -title: academically -date: 2014-06-10 12:31:19 -categories: writing ---- - -academically. So spelled --- not *academicly. E.g.: "The goal of the strategic -plan is to keep the university competitive economically and academicly -[read academically] through the year 2005, the release states." Frank Mastin -Jr., "84 Employees Lose Their Jobs at Tuskegee University," Montgomery -Advertiser, 2 Oct. 1997, at C2. See -IC. - -LANGUAGE-CHANGE INDEX academically misspelled *academicly: Stage 1 - -""" -from proselint.tools import supersede - -check = supersede("academically", "academicly", "MAU103") diff --git a/proselint/checks/mau_acquirer.py b/proselint/checks/mau_acquirer.py deleted file mode 100644 index 42ff8c3a8..000000000 --- a/proselint/checks/mau_acquirer.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -"""MAU102: Preferred spelling is 'acquirer'. - ---- -layout: post -error_code: MAU104 -source: Garner's Modern American Usage -source_url: http://amzn.to/15wF76r -title: acquirer -date: 2014-06-10 12:31:19 -categories: writing ---- - -acquirer. So spelled---not *acquiror. - -""" -from proselint.tools import supersede - -check = supersede("acquirer", "acquiror", "MAU104") diff --git a/proselint/checks/mau_addable.py b/proselint/checks/mau_addable.py deleted file mode 100644 index 9cb6a3f86..000000000 --- a/proselint/checks/mau_addable.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -"""MAU105: Misspelling of 'addable'. - ---- -layout: post -error_code: MAU105 -source: Garner's Modern American Usage -source_url: http://amzn.to/15wF76r -title: acquirer -date: 2014-06-10 12:31:19 -categories: writing ---- - -addable. So spelled---not *addible. See - ABLE (A). - -""" -from proselint.tools import supersede - -check = supersede("addable", "addible", "MAU105") diff --git a/proselint/checks/mau_adducible.py b/proselint/checks/mau_adducible.py deleted file mode 100644 index 8aa20ea50..000000000 --- a/proselint/checks/mau_adducible.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -"""MAU106: Misspelling of 'adducible'. - ---- -layout: post -error_code: MAU105 -source: Garner's Modern American Usage -source_url: http://amzn.to/15wF76r -title: adducible -date: 2014-06-10 12:31:19 -categories: writing ---- - -adducible. So spelled---not *adduceable. See -ABLE (A). - -""" -from proselint.tools import supersede - -check = supersede("adducible", "adduceable", "MAU106") diff --git a/proselint/checks/mau_preferred_forms.py b/proselint/checks/mau_preferred_forms.py new file mode 100644 index 000000000..8b257d6b5 --- /dev/null +++ b/proselint/checks/mau_preferred_forms.py @@ -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 diff --git a/proselint/checks/mau_redundancy.py b/proselint/checks/mau_redundancy.py new file mode 100644 index 000000000..bfa2cc66f --- /dev/null +++ b/proselint/checks/mau_redundancy.py @@ -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 diff --git a/proselint/checks/mau_tortfeasor.py b/proselint/checks/mau_tortfeasor.py deleted file mode 100644 index 4aa73c584..000000000 --- a/proselint/checks/mau_tortfeasor.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -"""MAU104: Incorrect hyphenation of tortfeasor. - ---- -layout: post -error_code: MAU104 -source: Garner's Modern American Usage -source_url: http://amzn.to/15wF76r -title: tortfeasor -date: 2014-06-10 12:31:19 -categories: writing ---- - -tortfeasor (= one who commits a civil wrong) was once spelled as two words -(tort feasor), then was hyphenated, and now has been fused into a single word. - - -""" -from proselint.tools import supersede - -check = supersede("tortfeasor", "tort feasor", "MAU104") -check = supersede("tortfeasor", "tort-feasor", "MAU104") diff --git a/proselint/tools.py b/proselint/tools.py index 88e2a2100..334c2d655 100644 --- a/proselint/tools.py +++ b/proselint/tools.py @@ -3,20 +3,6 @@ import shelve import inspect import functools -import re - - -def supersede(new, old, error_code): - """Replace one word with another.""" - def check(text): - msg = "It's '{}', not '{}'.".format(new, old) - errors = [] - for m in re.finditer(old, text, flags=re.IGNORECASE): - errors.append((m.start(), m.end(), error_code, msg)) - - return errors - - return check def memoize(f):