From 632ffa9393968cb3bf5c61b14d90b1c3be6b96d0 Mon Sep 17 00:00:00 2001 From: Jordan Suchow Date: Thu, 21 Jan 2016 22:36:40 -0800 Subject: [PATCH] Add stub of rule for professions #263 --- proselint/.proselintrc | 1 + proselint/checks/misc/professions.py | 30 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 proselint/checks/misc/professions.py diff --git a/proselint/.proselintrc b/proselint/.proselintrc index 72f6942f7..325db8191 100644 --- a/proselint/.proselintrc +++ b/proselint/.proselintrc @@ -45,6 +45,7 @@ "misc.hyperbolic" : true, "misc.link_checker" : false, "misc.password" : true, + "misc.professions" : true, "misc.whence" : true, "nfl.naughty_words" : false, "nordquist.redundancy" : true, diff --git a/proselint/checks/misc/professions.py b/proselint/checks/misc/professions.py new file mode 100644 index 000000000..3d5851dc0 --- /dev/null +++ b/proselint/checks/misc/professions.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +"""Profession. + +--- +layout: post +source: +source_url: +title: Professions +date: 2014-06-10 12:31:19 +categories: writing +--- + +Professions. + +""" +from tools import memoize, preferred_forms_check + + +@memoize +def check(text): + """Suggest the preferred forms.""" + err = "misc.professions" + msg = "'{}' is the name of that job." + + preferences = [ + + ["cobbler", ["shoe repair guy"]], + ] + + return preferred_forms_check(text, preferences, err, msg)