How to use the proselint.tools.preferred_forms_check function in proselint

To help you get started, we’ve selected a few proselint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github amperser / proselint / tests / test_preferred_forms_check.py View on Github external
def this_check(self):
        """Boilerplate."""
        return chk
github amperser / proselint / proselint / checks / misc / waxed.py View on Github external
("philosophical", "philosophically"),
                 ("poetic", "poetically"),
                 ("rhapsodic", "rhapsodically"),
                 ("romantic", "romantically"),
                 ("sentimental", "sentimentally")
                 ]

    def pairs(word):
        return [[word + ' ' + pair[0], [word + ' ' + pair[1]]]
                for pair in modifiers]

    preferred = []
    for word in waxes:
        preferred += pairs(word)

    return preferred_forms_check(text, preferred, err, msg)
github amperser / proselint / proselint / checks / misc / capitalization.py View on Github external
"""Suggest the preferred forms."""
    err = "MAU102"
    msg = "Days of the week should be capitalized. '{}' is the preferred form."

    list = [

        ["Monday",       ["monday"]],
        ["Tuesday",      ["tuesday"]],
        ["Wednesday",    ["wednesday"]],
        ["Thursday",     ["thursday"]],
        ["Friday",       ["friday"]],
        ["Saturday",     ["saturday"]],
        ["Sunday",       ["sunday"]],
    ]

    return preferred_forms_check(text, list, err, msg, ignore_case=False)
github amperser / proselint / proselint / checks / misc / capitalization.py View on Github external
["January",         ["january"]],
        ["February",        ["february"]],
        # ["March",           ["march"]],
        ["April",           ["april"]],
        # ["May",             ["may"]],
        ["June",            ["june"]],
        ["July",            ["july"]],
        ["August",          ["august"]],
        ["September",       ["september"]],
        ["October",         ["october"]],
        ["November",        ["november"]],
        ["December",        ["december"]],
    ]

    return preferred_forms_check(text, list, err, msg, ignore_case=False)
github amperser / proselint / proselint / checks / misc / latin.py View on Github external
def check(text):
    """Suggest the preferred forms."""
    err = "pinker.latin"
    msg = "Use English. '{}' is the preferred form."

    list = [
        ["other things being equal",          ["ceteris paribus"]],
        ["among other things",                ["inter alia"]],
        ["in and of itself",                  ["simpliciter"]],
        ["having made the necessary changes", ["mutatis mutandis"]],
    ]

    return preferred_forms_check(text, list, err, msg)
github amperser / proselint / proselint / checks / lgbtq / terms.py View on Github external
err = "glaad.terms"
    msg = "Possibly offensive term. Consider using '{}' instead of '{}'."

    list = [
        ["gay man",            ["homosexual man"]],
        ["gay men",            ["homosexual men"]],
        ["lesbian",            ["homosexual woman"]],
        ["lesbians",           ["homosexual women"]],
        ["gay people",         ["homosexual people"]],
        ["gay couple",         ["homosexual couple"]],
        ["sexual orientation", ["sexual preference"]],
        ["openly gay",         ["admitted homosexual", "avowed homosexual"]],
        ["equal rights",       ["special rights"]]
        ]

    return preferred_forms_check(text, list, err, msg, ignore_case=False)
github amperser / proselint / proselint / checks / misc / many_a.py View on Github external
def check(text):
    """Suggest the preferred forms."""
    err = "misc.many_a"
    msg = "'many a' requires a singular verb."

    preferences = [
        ["is many a",          ["are many a"]],
        ["has been many a",    ["have been many a"]],
        ["was many a",         ["were many a"]],
    ]

    return preferred_forms_check(text, preferences, err, msg)
github amperser / proselint / proselint / checks / typography / symbols.py View on Github external
def check_curly_quotes(text):
    u"""Use curly quotes, not straight quotes."""
    err = "typography.symbols.curly_quotes"
    msg = u'Use curly quotes “”, not straight quotes "".'

    list = [
        [u"“ or ”", ['"']],
    ]

    return preferred_forms_check(
        text, list, err, msg, ignore_case=False, max_errors=2)
github amperser / proselint / proselint / checks / spelling / er_or.py View on Github external
["idolater",            ["idolator"]],
        ["impostor",            ["imposter"]],
        ["infiltrator",         ["infiltrater"]],
        ["investor",            ["invester"]],
        ["manipulator",         ["manipulater"]],
        ["mortgagor",           ["mortgager"]],
        ["persecutor",          ["persecuter"]],
        ["promoter",            ["promotor"]],
        ["promoter",            ["promotor"]],
        ["purveyor",            ["purveyer"]],
        ["requester",           ["requestor"]],
        ["reviser",             ["revisor"]],
        ["surveyor",            ["surveyer"]],
    ]

    return preferred_forms_check(text, preferences, err, msg)
github amperser / proselint / proselint / checks / spelling / able_atable.py View on Github external
["perpetrable",       ["perpetratable"]],
        ["perpetuable",       ["perpetuatable"]],
        ["predicable",        ["predicatable"]],
        ["propagable",        ["propagatable"]],
        ["regulable",         ["regulatable"]],
        ["replicable",        ["replicatable"]],
        ["repudiable",        ["repudiatable"]],
        ["segregable",        ["segregatable"]],
        ["separable",         ["separatable"]],
        ["subjugable",        ["subjugatable"]],
        ["vindicable",        ["vindicatable"]],
        ["violable",          ["violatable"]],
        ["vitiable",          ["vitiatable"]]
    ]

    return preferred_forms_check(text, preferences, err, msg)