[Python-modules-commits] [python-proselint] 01/02: Imported Upstream version 0.3.5
Víctor Cuadrado Juan
viccuad-guest at moszumanska.debian.org
Sun Feb 28 14:27:44 UTC 2016
This is an automated email from the git hooks/post-receive script.
viccuad-guest pushed a commit to branch master
in repository python-proselint.
commit 3d07039afeb0d65c064bdc5ed0bbaec2f0cff8e7
Author: Víctor Cuadrado Juan <me at viccuad.me>
Date: Sun Feb 28 02:47:18 2016 +0100
Imported Upstream version 0.3.5
---
PKG-INFO | 11 +
proselint.egg-info/PKG-INFO | 11 +
proselint.egg-info/SOURCES.txt | 119 +++
proselint.egg-info/dependency_links.txt | 1 +
proselint.egg-info/entry_points.txt | 3 +
proselint.egg-info/not-zip-safe | 1 +
proselint.egg-info/requires.txt | 3 +
proselint.egg-info/top_level.txt | 2 +
proselint/.proselintrc | 72 ++
proselint/__init__.py | 1 +
proselint/checks/__init__.py | 1 +
proselint/checks/butterick/__init__.py | 1 +
proselint/checks/butterick/symbols.py | 78 ++
proselint/checks/carlin/__init__.py | 1 +
proselint/checks/carlin/filth.py | 39 +
proselint/checks/consistency/__init__.py | 1 +
proselint/checks/consistency/spacing.py | 27 +
proselint/checks/consistency/spelling.py | 47 +
proselint/checks/garner/__init__.py | 1 +
proselint/checks/garner/airlinese.py | 31 +
proselint/checks/garner/am_pm.py | 58 ++
proselint/checks/garner/animal_labels.py | 71 ++
proselint/checks/garner/archaism.py | 83 ++
proselint/checks/garner/back_formations.py | 29 +
proselint/checks/garner/bureaucratese.py | 30 +
proselint/checks/garner/capitalization.py | 93 ++
proselint/checks/garner/cliches.py | 106 ++
proselint/checks/garner/commercialese.py | 54 +
proselint/checks/garner/dates.py | 68 ++
proselint/checks/garner/denizen_labels.py | 65 ++
proselint/checks/garner/illogic.py | 60 ++
proselint/checks/garner/jargon.py | 34 +
proselint/checks/garner/malapropisms.py | 31 +
proselint/checks/garner/many_a.py | 31 +
proselint/checks/garner/misspelling.py | 149 +++
proselint/checks/garner/mixed_metaphors.py | 34 +
proselint/checks/garner/mondegreens.py | 36 +
proselint/checks/garner/needless_variants.py | 388 +++++++
proselint/checks/garner/oxymorons.py | 49 +
proselint/checks/garner/preferred_forms.py | 523 ++++++++++
proselint/checks/garner/punctuation.py | 29 +
proselint/checks/garner/redundancy.py | 144 +++
proselint/checks/garner/sexism.py | 56 +
proselint/checks/gowers/__init__.py | 1 +
proselint/checks/gowers/overworked_metaphors.py | 32 +
proselint/checks/inc/__init__.py | 1 +
proselint/checks/inc/corporate_speak.py | 53 +
proselint/checks/junge/__init__.py | 2 +
proselint/checks/junge/but.py | 15 +
proselint/checks/leonard/__init__.py | 1 +
proselint/checks/leonard/exclamation.py | 47 +
proselint/checks/leonard/hell.py | 28 +
proselint/checks/lilienfeld/__init__.py | 1 +
proselint/checks/lilienfeld/terms_to_avoid.py | 55 +
proselint/checks/misc/__init__.py | 1 +
proselint/checks/misc/annotations.py | 35 +
proselint/checks/misc/chatspeak.py | 51 +
proselint/checks/misc/credit_card.py | 33 +
proselint/checks/misc/currency.py | 29 +
proselint/checks/misc/eponymous_adjectives.py | 31 +
proselint/checks/misc/hyperbolic.py | 30 +
proselint/checks/misc/link_checker.py | 64 ++
proselint/checks/misc/password.py | 34 +
proselint/checks/misc/whence.py | 25 +
proselint/checks/nfl/__init__.py | 1 +
proselint/checks/nfl/naughty_words.py | 1183 ++++++++++++++++++++++
proselint/checks/nordquist/__init__.py | 1 +
proselint/checks/nordquist/redundancy.py | 31 +
proselint/checks/norris/__init__.py | 1 +
proselint/checks/norris/denizen_labels.py | 42 +
proselint/checks/nytimes/__init__.py | 1 +
proselint/checks/ogilvy/__init__.py | 1 +
proselint/checks/ogilvy/pretension.py | 32 +
proselint/checks/orwell/__init__.py | 1 +
proselint/checks/orwell/debased.py | 32 +
proselint/checks/oxford/__init__.py | 1 +
proselint/checks/oxford/venery_terms.py | 88 ++
proselint/checks/palahniuk/__init__.py | 1 +
proselint/checks/palahniuk/suddenly.py | 39 +
proselint/checks/pinker/__init__.py | 1 +
proselint/checks/pinker/apologizing.py | 29 +
proselint/checks/pinker/hedging.py | 31 +
proselint/checks/pinker/latin.py | 32 +
proselint/checks/pinker/metaconcepts.py | 29 +
proselint/checks/pinker/metadiscourse.py | 33 +
proselint/checks/pinker/narcisissm.py | 29 +
proselint/checks/pinker/scare_quotes.py | 29 +
proselint/checks/strunk_white/__init__.py | 1 +
proselint/checks/strunk_white/composition.py | 83 ++
proselint/checks/strunk_white/greylist.py | 45 +
proselint/checks/strunk_white/usage.py | 62 ++
proselint/checks/szekely/__init__.py | 1 +
proselint/checks/szekely/nword.py | 29 +
proselint/checks/twain/__init__.py | 1 +
proselint/checks/twain/damn.py | 29 +
proselint/checks/wallace/__init__.py | 1 +
proselint/checks/wallace/redundancy.py | 29 +
proselint/checks/wallace/tense_present.py | 46 +
proselint/checks/wallace/uncomparables.py | 119 +++
proselint/checks/write_good/__init__.py | 1 +
proselint/checks/write_good/cliches.py | 725 +++++++++++++
proselint/checks/write_good/lexical_illusions.py | 31 +
proselint/checks/write_good/weasel_words.py | 22 +
proselint/checks/wsj/__init__.py | 1 +
proselint/checks/wsj/athletes.py | 45 +
proselint/command_line.py | 198 ++++
proselint/demo.md | 184 ++++
proselint/score.py | 77 ++
proselint/tools.py | 267 +++++
proselint/version.py | 3 +
setup.cfg | 8 +
setup.py | 29 +
tests/__init__.py | 1 +
tests/_test_version.py | 19 +
tests/check.py | 65 ++
tests/test_demo.py | 5 +
tests/test_dfw_uncomparables.py | 29 +
tests/test_garner_dates.py | 35 +
tests/test_strunk_white_eos.py | 24 +
tests/test_topic_detector.py | 19 +
120 files changed, 7143 insertions(+)
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..3f47fe5
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,11 @@
+Metadata-Version: 1.1
+Name: proselint
+Version: 0.3.5
+Summary: A linter for prose
+Home-page: http://github.com/amperser/proselint
+Author: Amperser Labs
+Author-email: hello at amperser.com
+License: BSD
+Download-URL: http://github.com/amperser/proselint/tarball/0.3.5
+Description: UNKNOWN
+Platform: UNKNOWN
diff --git a/proselint.egg-info/PKG-INFO b/proselint.egg-info/PKG-INFO
new file mode 100644
index 0000000..3f47fe5
--- /dev/null
+++ b/proselint.egg-info/PKG-INFO
@@ -0,0 +1,11 @@
+Metadata-Version: 1.1
+Name: proselint
+Version: 0.3.5
+Summary: A linter for prose
+Home-page: http://github.com/amperser/proselint
+Author: Amperser Labs
+Author-email: hello at amperser.com
+License: BSD
+Download-URL: http://github.com/amperser/proselint/tarball/0.3.5
+Description: UNKNOWN
+Platform: UNKNOWN
diff --git a/proselint.egg-info/SOURCES.txt b/proselint.egg-info/SOURCES.txt
new file mode 100644
index 0000000..4e105a9
--- /dev/null
+++ b/proselint.egg-info/SOURCES.txt
@@ -0,0 +1,119 @@
+setup.cfg
+setup.py
+proselint/.proselintrc
+proselint/__init__.py
+proselint/command_line.py
+proselint/demo.md
+proselint/score.py
+proselint/tools.py
+proselint/version.py
+proselint.egg-info/PKG-INFO
+proselint.egg-info/SOURCES.txt
+proselint.egg-info/dependency_links.txt
+proselint.egg-info/entry_points.txt
+proselint.egg-info/not-zip-safe
+proselint.egg-info/requires.txt
+proselint.egg-info/top_level.txt
+proselint/checks/__init__.py
+proselint/checks/butterick/__init__.py
+proselint/checks/butterick/symbols.py
+proselint/checks/carlin/__init__.py
+proselint/checks/carlin/filth.py
+proselint/checks/consistency/__init__.py
+proselint/checks/consistency/spacing.py
+proselint/checks/consistency/spelling.py
+proselint/checks/garner/__init__.py
+proselint/checks/garner/airlinese.py
+proselint/checks/garner/am_pm.py
+proselint/checks/garner/animal_labels.py
+proselint/checks/garner/archaism.py
+proselint/checks/garner/back_formations.py
+proselint/checks/garner/bureaucratese.py
+proselint/checks/garner/capitalization.py
+proselint/checks/garner/cliches.py
+proselint/checks/garner/commercialese.py
+proselint/checks/garner/dates.py
+proselint/checks/garner/denizen_labels.py
+proselint/checks/garner/illogic.py
+proselint/checks/garner/jargon.py
+proselint/checks/garner/malapropisms.py
+proselint/checks/garner/many_a.py
+proselint/checks/garner/misspelling.py
+proselint/checks/garner/mixed_metaphors.py
+proselint/checks/garner/mondegreens.py
+proselint/checks/garner/needless_variants.py
+proselint/checks/garner/oxymorons.py
+proselint/checks/garner/preferred_forms.py
+proselint/checks/garner/punctuation.py
+proselint/checks/garner/redundancy.py
+proselint/checks/garner/sexism.py
+proselint/checks/gowers/__init__.py
+proselint/checks/gowers/overworked_metaphors.py
+proselint/checks/inc/__init__.py
+proselint/checks/inc/corporate_speak.py
+proselint/checks/junge/__init__.py
+proselint/checks/junge/but.py
+proselint/checks/leonard/__init__.py
+proselint/checks/leonard/exclamation.py
+proselint/checks/leonard/hell.py
+proselint/checks/lilienfeld/__init__.py
+proselint/checks/lilienfeld/terms_to_avoid.py
+proselint/checks/misc/__init__.py
+proselint/checks/misc/annotations.py
+proselint/checks/misc/chatspeak.py
+proselint/checks/misc/credit_card.py
+proselint/checks/misc/currency.py
+proselint/checks/misc/eponymous_adjectives.py
+proselint/checks/misc/hyperbolic.py
+proselint/checks/misc/link_checker.py
+proselint/checks/misc/password.py
+proselint/checks/misc/whence.py
+proselint/checks/nfl/__init__.py
+proselint/checks/nfl/naughty_words.py
+proselint/checks/nordquist/__init__.py
+proselint/checks/nordquist/redundancy.py
+proselint/checks/norris/__init__.py
+proselint/checks/norris/denizen_labels.py
+proselint/checks/nytimes/__init__.py
+proselint/checks/ogilvy/__init__.py
+proselint/checks/ogilvy/pretension.py
+proselint/checks/orwell/__init__.py
+proselint/checks/orwell/debased.py
+proselint/checks/oxford/__init__.py
+proselint/checks/oxford/venery_terms.py
+proselint/checks/palahniuk/__init__.py
+proselint/checks/palahniuk/suddenly.py
+proselint/checks/pinker/__init__.py
+proselint/checks/pinker/apologizing.py
+proselint/checks/pinker/hedging.py
+proselint/checks/pinker/latin.py
+proselint/checks/pinker/metaconcepts.py
+proselint/checks/pinker/metadiscourse.py
+proselint/checks/pinker/narcisissm.py
+proselint/checks/pinker/scare_quotes.py
+proselint/checks/strunk_white/__init__.py
+proselint/checks/strunk_white/composition.py
+proselint/checks/strunk_white/greylist.py
+proselint/checks/strunk_white/usage.py
+proselint/checks/szekely/__init__.py
+proselint/checks/szekely/nword.py
+proselint/checks/twain/__init__.py
+proselint/checks/twain/damn.py
+proselint/checks/wallace/__init__.py
+proselint/checks/wallace/redundancy.py
+proselint/checks/wallace/tense_present.py
+proselint/checks/wallace/uncomparables.py
+proselint/checks/write_good/__init__.py
+proselint/checks/write_good/cliches.py
+proselint/checks/write_good/lexical_illusions.py
+proselint/checks/write_good/weasel_words.py
+proselint/checks/wsj/__init__.py
+proselint/checks/wsj/athletes.py
+tests/__init__.py
+tests/_test_version.py
+tests/check.py
+tests/test_demo.py
+tests/test_dfw_uncomparables.py
+tests/test_garner_dates.py
+tests/test_strunk_white_eos.py
+tests/test_topic_detector.py
\ No newline at end of file
diff --git a/proselint.egg-info/dependency_links.txt b/proselint.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/proselint.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/proselint.egg-info/entry_points.txt b/proselint.egg-info/entry_points.txt
new file mode 100644
index 0000000..33a17c1
--- /dev/null
+++ b/proselint.egg-info/entry_points.txt
@@ -0,0 +1,3 @@
+[console_scripts]
+proselint = proselint.command_line:proselint
+
diff --git a/proselint.egg-info/not-zip-safe b/proselint.egg-info/not-zip-safe
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/proselint.egg-info/not-zip-safe
@@ -0,0 +1 @@
+
diff --git a/proselint.egg-info/requires.txt b/proselint.egg-info/requires.txt
new file mode 100644
index 0000000..1e1463c
--- /dev/null
+++ b/proselint.egg-info/requires.txt
@@ -0,0 +1,3 @@
+click
+future
+six
diff --git a/proselint.egg-info/top_level.txt b/proselint.egg-info/top_level.txt
new file mode 100644
index 0000000..5e51058
--- /dev/null
+++ b/proselint.egg-info/top_level.txt
@@ -0,0 +1,2 @@
+proselint
+tests
diff --git a/proselint/.proselintrc b/proselint/.proselintrc
new file mode 100644
index 0000000..89ced5f
--- /dev/null
+++ b/proselint/.proselintrc
@@ -0,0 +1,72 @@
+{
+ "max_errors": 1000,
+ "checks": {
+ "butterick.symbols" : true,
+ "carlin.filth" : true,
+ "consistency.spacing" : true,
+ "consistency.spelling" : true,
+ "garner.airlinese" : true,
+ "garner.am_pm" : true,
+ "garner.animal_labels" : true,
+ "garner.archaism" : true,
+ "garner.back_formations" : true,
+ "garner.bureaucratese" : true,
+ "garner.capitalization" : true,
+ "garner.cliches" : true,
+ "garner.commercialese" : true,
+ "garner.dates" : true,
+ "garner.denizen_labels" : true,
+ "garner.illogic" : true,
+ "garner.jargon" : true,
+ "garner.malapropisms" : true,
+ "garner.many_a" : true,
+ "garner.misspelling" : true,
+ "garner.mixed_metaphors" : true,
+ "garner.mondegreens" : true,
+ "garner.needless_variants" : true,
+ "garner.oxymorons" : true,
+ "garner.preferred_forms" : true,
+ "garner.punctuation" : true,
+ "garner.redundancy" : true,
+ "garner.sexism" : true,
+ "gowers.overworked_metaphors" : true,
+ "inc.corporate_speak" : true,
+ "leonard.exclamation" : true,
+ "leonard.hell" : true,
+ "lilienfeld.terms_to_avoid" : true,
+ "misc.annotations" : true,
+ "misc.chatspeak" : true,
+ "misc.credit_card" : true,
+ "misc.currency" : true,
+ "misc.eponymous_adjectives" : true,
+ "misc.hyperbolic" : true,
+ "misc.link_checker" : false,
+ "misc.password" : true,
+ "misc.whence" : true,
+ "nfl.naughty_words" : false,
+ "nordquist.redundancy" : true,
+ "norris.denizen_labels" : true,
+ "ogilvy.pretension" : true,
+ "orwell.debased" : true,
+ "oxford.venery_terms" : true,
+ "palahniuk.suddenly" : true,
+ "pinker.apologizing" : true,
+ "pinker.hedging" : true,
+ "pinker.latin" : true,
+ "pinker.metaconcepts" : true,
+ "pinker.narcisissm" : true,
+ "pinker.scare_quotes" : true,
+ "szekely.nword" : true,
+ "strunk_white.composition" : true,
+ "strunk_white.greylist" : true,
+ "strunk_white.usage" : true,
+ "twain.damn" : true,
+ "wallace.redundancy" : true,
+ "wallace.tense_present" : true,
+ "wallace.uncomparables" : true,
+ "write_good.cliches" : true,
+ "write_good.lexical_illusions" : true,
+ "write_good.weasel_words" : true,
+ "wsj.athletes" : true
+ }
+}
diff --git a/proselint/__init__.py b/proselint/__init__.py
new file mode 100644
index 0000000..9cd4315
--- /dev/null
+++ b/proselint/__init__.py
@@ -0,0 +1 @@
+"""Proselint applies advice from great writers to your writing."""
diff --git a/proselint/checks/__init__.py b/proselint/checks/__init__.py
new file mode 100644
index 0000000..a568e93
--- /dev/null
+++ b/proselint/checks/__init__.py
@@ -0,0 +1 @@
+"""All the checks are organized into modules and places here."""
diff --git a/proselint/checks/butterick/__init__.py b/proselint/checks/butterick/__init__.py
new file mode 100644
index 0000000..2aa8c99
--- /dev/null
+++ b/proselint/checks/butterick/__init__.py
@@ -0,0 +1 @@
+"""Advice from Butterick's Practical Typography."""
diff --git a/proselint/checks/butterick/symbols.py b/proselint/checks/butterick/symbols.py
new file mode 100644
index 0000000..b66e795
--- /dev/null
+++ b/proselint/checks/butterick/symbols.py
@@ -0,0 +1,78 @@
+# -*- coding: utf-8 -*-
+"""Use the symbols.
+
+---
+layout: post
+source: Butterick's Practical Typography
+source_url: http://practicaltypography.com/
+title: Tense present
+date: 2014-06-10 12:31:19
+categories: writing
+---
+
+Use the symbols.
+
+"""
+from tools import memoize, existence_check
+
+
+ at memoize
+def check_ellipsis(text):
+ """Use an ellipsis instead of three dots."""
+ err = "butterick.symbols.ellipsis"
+ msg = u"'...' is an approximation, use the ellipsis symbol '…'."
+ regex = "\.\.\."
+
+ return existence_check(text, [regex], err, msg, max_errors=3,
+ require_padding=False, offset=0)
+
+
+ at memoize
+def check_copyright_symbol(text):
+ """Use the copyright symbol instead of (c)."""
+ err = "butterick.symbols.copyright"
+ msg = u"(c) is a goofy alphabetic approximation, use the symbol ©."
+ regex = "\([cC]\)"
+
+ return existence_check(
+ text, [regex], err, msg, max_errors=1, require_padding=False)
+
+
+ at memoize
+def check_trademark_symbol(text):
+ """Use the trademark symbol instead of (TM)."""
+ err = "butterick.symbols.trademark"
+ msg = u"(TM) is a goofy alphabetic approximation, use the symbol ™."
+ regex = "\(TM\)"
+
+ return existence_check(
+ text, [regex], err, msg, max_errors=3, require_padding=False)
+
+
+ at memoize
+def check_registered_trademark_symbol(text):
+ """Use the registered trademark symbol instead of (R)."""
+ err = "butterick.symbols.trademark"
+ msg = u"(R) is a goofy alphabetic approximation, use the symbol ®."
+ regex = "\([rR]\)"
+
+ return existence_check(
+ text, [regex], err, msg, max_errors=3, require_padding=False)
+
+
+ at memoize
+def check_sentence_spacing(text):
+ """Use no more than two spaces after a period."""
+ err = "butterick.symbols.sentence_spacing"
+ msg = u"More than two spaces after the period; use 1 or 2."
+ regex = "\. {3}"
+
+ return existence_check(
+ text, [regex], err, msg, max_errors=3, require_padding=False)
+
+
+# @memoize
+# def check_en_dash_separated_names(text):
+# """Use an en-dash to separate names."""
+# # [u"[A-Z][a-z]{1,10}[-\u2014][A-Z][a-z]{1,10}",
+# # u"Use an en dash (–) to separate names."],
diff --git a/proselint/checks/carlin/__init__.py b/proselint/checks/carlin/__init__.py
new file mode 100644
index 0000000..1a4b9a2
--- /dev/null
+++ b/proselint/checks/carlin/__init__.py
@@ -0,0 +1 @@
+"""'Advice' from George Carlin."""
diff --git a/proselint/checks/carlin/filth.py b/proselint/checks/carlin/filth.py
new file mode 100644
index 0000000..fe3cb63
--- /dev/null
+++ b/proselint/checks/carlin/filth.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+"""Filthy words.
+
+---
+layout: post
+source: George Carlin
+source_url: https://youtu.be/kyBH5oNQOS0
+title: filthy words
+date: 2014-06-10 12:31:19
+categories: writing
+---
+
+Filthy words.
+
+"""
+from tools import existence_check, memoize
+
+
+ at memoize
+def check_debased_language(text):
+ """Check the text."""
+ err = "carlin.filth"
+ msg = u"""Nobody ever tells you this as a kid, but you're supposed to avoid
+ this word."""
+
+ list = [
+ "shit",
+ "piss",
+ "fuck",
+ "cunt",
+ "cocksucker",
+ "motherfucker",
+ "tits",
+ "fart",
+ "turd",
+ "twat",
+ ]
+
+ return existence_check(text, list, err, msg)
diff --git a/proselint/checks/consistency/__init__.py b/proselint/checks/consistency/__init__.py
new file mode 100644
index 0000000..902e36d
--- /dev/null
+++ b/proselint/checks/consistency/__init__.py
@@ -0,0 +1 @@
+"""Various consistency checks."""
diff --git a/proselint/checks/consistency/spacing.py b/proselint/checks/consistency/spacing.py
new file mode 100644
index 0000000..c9f0ad9
--- /dev/null
+++ b/proselint/checks/consistency/spacing.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+"""Mixed one vs. two spaces after a period.
+
+---
+layout: post
+source: Consistency.
+source_url: ???
+title: Mixed use of 1 vs. 2 spaces after a period.
+date: 2014-06-10 12:31:19
+categories: writing
+---
+
+Points out instances where there are two conventions, 1 vs. 2 spaces after
+a period, in the same document.
+
+"""
+from tools import consistency_check, memoize
+
+
+ at memoize
+def check(text):
+ """Check the text."""
+ err = "consistency.spacing"
+ msg = "Inconsistent spacing after period (1 vs. 2 spaces)."
+
+ regex = ["[\.\?!] [A-Z]", "[\.\?!] [A-Z]"]
+ return consistency_check(text, [regex], err, msg)
diff --git a/proselint/checks/consistency/spelling.py b/proselint/checks/consistency/spelling.py
new file mode 100644
index 0000000..5743750
--- /dev/null
+++ b/proselint/checks/consistency/spelling.py
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+"""Inconsistent spelling.
+
+---
+layout: post
+source: Intelligent Editing Ltd.
+source_url: http://bit.ly/1x3hYj7
+title: Inconsistent spelling
+date: 2014-06-10 12:31:19
+categories: writing
+---
+
+Intelligent Editing Ltd. says:
+
+> Some words have more than one correct spelling. American, British, Australian
+and Canadian English all have their own preferences. Even within those, there
+can be multiple spellings. For example, in the UK 'realise' is often preferred.
+However, 'realize' has been used in British-English for centuries and is
+preferred in the Oxford English Dictionary. However, no matter which spelling
+is preferred, one thing is always wrong: you mustn't use two different
+spellings in the same document.
+"""
+from tools import consistency_check, memoize
+
+
+ at memoize
+def check(text):
+ """Check the text."""
+ err = "consistency.spelling"
+ msg = "Inconsistent spelling of '{}' (vs. '{}')."
+
+ word_pairs = [
+ ["advisor", "adviser"],
+ # ["analyse", "analyze"],
+ ["centre", "center"],
+ ["emphasise", "emphasize"],
+ ["finalise", "finalize"],
+ ["focussed", "focused"],
+ ["labour", "labor"],
+ ["learnt", "learned"],
+ ["organise", "organize"],
+ ["organised", "organized"],
+ ["organising", "organizing"],
+ ["recognise", "recognize"],
+ ]
+
+ return consistency_check(text, word_pairs, err, msg)
diff --git a/proselint/checks/garner/__init__.py b/proselint/checks/garner/__init__.py
new file mode 100644
index 0000000..ae2ec61
--- /dev/null
+++ b/proselint/checks/garner/__init__.py
@@ -0,0 +1 @@
+"""Advice from Garner's Modern Ameican Usage."""
diff --git a/proselint/checks/garner/airlinese.py b/proselint/checks/garner/airlinese.py
new file mode 100644
index 0000000..b3402e1
--- /dev/null
+++ b/proselint/checks/garner/airlinese.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+"""Airlinese.
+
+---
+layout: post
+source: Garner's Modern American Usage
+source_url: http://amzn.to/15wF76r
+title: Airlinese
+date: 2014-06-10 12:31:19
+categories: writing
+---
+
+Airlinese.
+
+"""
+from tools import existence_check, memoize
+
+
+ at memoize
+def check(text):
+ """Check the text."""
+ err = "garner.airlinese"
+ msg = u"'{}' is airlinese."
+
+ airlinese = [
+ "enplan(?:e|ed|ing|ement)",
+ "deplan(?:e|ed|ing|ement)",
+ "taking off momentarily",
+ ]
+
+ return existence_check(text, airlinese, err, msg)
diff --git a/proselint/checks/garner/am_pm.py b/proselint/checks/garner/am_pm.py
new file mode 100644
index 0000000..726ea0d
--- /dev/null
+++ b/proselint/checks/garner/am_pm.py
@@ -0,0 +1,58 @@
+# -*- coding: utf-8 -*-
+u"""a.m. / p.m.
+
+---
+layout: post
+source: Garner's Modern American Usage
+source_url: http://amzn.to/15wF76r
+title: a.m. & p.m.
+date: 2014-06-10 12:31:19
+categories: writing
+---
+
+"""
+from tools import memoize, existence_check
+
+
+ at memoize
+def check_lowercase_periods(text):
+ """Check the text."""
+ err = "garner.am_pm.lowercase_periods"
+ msg = u"With lowercase letters, the periods are standard."
+
+ return existence_check(text, ["\d{1,2} ?[ap]m"], err, msg)
+
+
+ at memoize
+def check_spacing(text):
+ """Check the text."""
+ err = "garner.am_pm.spacing"
+ msg = u"It's standard to put a space before 'a.m.' or 'p.m.'."
+
+ return existence_check(text, ["\d{1,2}[ap]\.?m\.?"], err, msg)
+
+
+ at memoize
+def check_midnight_noon(text):
+ """Check the text."""
+ err = "garner.am_pm.midnight_noon"
+ msg = (u"12 a.m. and 12 p.m. are wrong and confusing."
+ " Use 'midnight' or 'noon'.")
+
+ return existence_check(text, ["12 ?[ap]\.?m\.?"], err, msg)
+
+
+ at memoize
+def check_redundancy(text):
+ """Check the text."""
+ err = "garner.am_pm.midnight_noon"
+ msg = (u"'a.m.' is always morning; 'p.m.' is always night.")
+
+ list = [
+ "\d{1,2} ?a\.?m\.? in the morning",
+ "\d{1,2} ?p\.?m\.? in the evening",
+ "\d{1,2} ?p\.?m\.? at night",
+ "\d{1,2} ?p\.?m\.? in the afternoon",
+ ]
+
+ return existence_check(text, list, err, msg, join=True)
diff --git a/proselint/checks/garner/animal_labels.py b/proselint/checks/garner/animal_labels.py
new file mode 100644
index 0000000..0b37cec
--- /dev/null
+++ b/proselint/checks/garner/animal_labels.py
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+"""Animal word.
+
+---
+layout: post
+source: Garner's Modern American Usage
+source_url: http://amzn.to/15wF76r
+title: animal words
+date: 2014-06-10 12:31:19
+categories: writing
+---
+
+Animal words.
+
+"""
+from tools import memoize, preferred_forms_check
+
+
+ at memoize
+def check(text):
+ """Suggest the preferred forms."""
+ err = "garner.animal_labels"
+ msg = "There's a word for this: '{}'."
+
+ preferences = [
+
+ ["accipitrine", ["hawk-like"]],
+ ["anserine", ["goose-like"]],
+ ["aquiline", ["eagle-like"]],
+ ["avine", ["bird-like"]],
+ ["cancrine", ["crab-like"]],
+ ["hircine", ["goat-like"]],
+ ["damine", ["deer-like"]],
+ ["corvine", ["crow-like", "raven-like"]],
+ ["crocodiline", ["crocodile-like"]],
+ ["crotaline", ["rattlesnake-like"]],
+ ["falconine", ["falcon-like"]],
+ ["ferine", ["wild animal-like"]],
+ ["hippopotamine", ["hippopotamus-like"]],
+ ["hirundine", ["swallow-like"]],
+ ["hystricine", ["porcupine-like"]],
+ ["lacertine", ["lizard-like"]],
+ ["laridine", ["gull-like"]],
+ ["leporine", ["hare-like"]],
+ ["lumbricine", ["earthworm-like"]],
+ ["lupine", ["wolf-like"]],
+ ["murine", ["mouse-like"]],
+ ["ovine", ["sheep-like"]],
+ ["pardine", ["leopard-like", "panther-like"]],
+ ["passerine", ["sparrow-like"]],
+ ["pavonine", ["peacock-like"]],
+ ["picine", ["woodpecker-like"]],
+ ["piscine", ["fish-like"]],
+ ["ranine", ["frog-like"]],
+ ["scolopendrine", ["centipede-like"]],
+ ["soricine", ["shrew-like"]],
+ ["struthionine", ["ostrich-like"]],
+ ["suilline", ["swine-like"]],
+ ["taurine", ["bull-like", "ox-like"]],
+ ["tigrine", ["tiger-like"]],
+ ["vespine", ["wasp-like"]],
+ ["viperine", ["viper-like"]],
+ ["vituline", ["calf-like", "veal-like"]],
+ ["viverrine", ["mongoose-like"]],
+ ["vulpine", ["fox-like"]],
+ ["vulturine", ["vulture-like"]],
+ ["zebrine", ["zebra-like"]],
+ ["zibeline", ["sable-like"]],
+ ]
+
+ return preferred_forms_check(text, preferences, err, msg)
diff --git a/proselint/checks/garner/archaism.py b/proselint/checks/garner/archaism.py
new file mode 100644
index 0000000..ad2acaa
--- /dev/null
+++ b/proselint/checks/garner/archaism.py
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+"""Archaism.
+
+---
+layout: post
+source: Garner's Modern American Usage
+source_url: http://amzn.to/15wF76r
+title: archaism
+date: 2014-06-10 12:31:19
+categories: writing
+---
+
+Archaism.
+
+"""
+from tools import existence_check, memoize
+
+
+ at memoize
+def check(text):
+ """Check the text."""
+ err = "garner.archaism"
+ msg = u"'{}' is archaic."
+
+ archaisms = [
+ "alack",
+ "anent",
+ # "anon",
+ "begat",
+ "belike",
+ "betimes",
+ "boughten",
+ "brocage",
+ "brokage",
+ "camarade",
+ "chiefer",
+ "chiefest",
+ "Christiana",
+ "completely obsolescent",
+ "cozen",
+ "divers",
+ "deflexion",
+ "durst",
+ "fain",
+ "forsooth",
+ "foreclose from",
+ "haply",
+ "howbeit",
+ "illumine",
+ "in sooth",
+ "maugre",
+ "meseems",
+ "methinks",
+ "nigh",
+ "peradventure",
+ "perchance",
+ "saith",
+ "shew",
+ "sistren",
+ "spake",
+ "to wit",
+ "verily",
+ "whilom",
+ "withal",
+ "wot",
+ "enclosed please find",
+ "please find enclosed",
+ "enclosed herewith",
+ "enclosed herein",
+ "inforce",
+ "ex postfacto",
+ "foreclose from",
+ "forewent",
+ "for ever",
+ # "designer", when used to mean a plotter against Christ
+ # "demean", when used to mean "to behave" in legal contexts
+ # "by the bye", # variant, modern is "by the by"
+ # "comptroller" # in british english
+ # "abortive" Abortive is archaic in reference to abortions of fetuses,
+ # except in the sense “causing an abortion.”
+ ]
+
+ return existence_check(text, archaisms, err, msg, join=True)
diff --git a/proselint/checks/garner/back_formations.py b/proselint/checks/garner/back_formations.py
new file mode 100644
index 0000000..7fb2e7c
--- /dev/null
+++ b/proselint/checks/garner/back_formations.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+"""Back-formations.
+
+---
+layout: post
+source: Garner's Modern American Usage
+source_url: http://amzn.to/15wF76r
+title: back-formations
+date: 2014-06-10 12:31:19
+categories: writing
+---
+
+Back-formations.
+
+"""
+from tools import memoize, preferred_forms_check
+
+
+ at memoize
+def check(text):
+ """Suggest the preferred forms."""
+ err = "garner.back_formations"
+ msg = "Back-formation. '{}' is the preferred form."
+
+ list = [
+ ["improper", ["improprietous"]],
+ ]
+
+ return preferred_forms_check(text, list, err, msg)
diff --git a/proselint/checks/garner/bureaucratese.py b/proselint/checks/garner/bureaucratese.py
new file mode 100644
index 0000000..6f6eacd
--- /dev/null
+++ b/proselint/checks/garner/bureaucratese.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+"""Bureaucratese.
+
+---
+layout: post
+source: Garner's Modern American Usage
+source_url: http://amzn.to/15wF76r
+title: bureaucratese
+date: 2014-06-10 12:31:19
+categories: writing
+---
+
+Bureaucratese.
+
+"""
+from tools import existence_check, memoize
+
+
+ at memoize
+def check(text):
+ """Check the text."""
+ err = "garner.bureaucratese"
+ msg = u"'{}' is bureaucratese."
+
+ bureaucratese = [
+ "meet with your approval",
+ "meets with your approval",
+ ]
+
... 6992 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-proselint.git
More information about the Python-modules-commits
mailing list