Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def this_check(self):
"""Boilerplate."""
return chk
("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)
"""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)
["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)
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)
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)
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)
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)
["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)
["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)