diff --git a/proselint/.proselintrc b/proselint/.proselintrc index 5a8759245..d21109744 100644 --- a/proselint/.proselintrc +++ b/proselint/.proselintrc @@ -60,6 +60,7 @@ "psychology.misc" : true, "redundancy.misc" : true, "redundancy.ras_syndrome" : true, + "redundancy.adverb_dialogue" : true, "skunked_terms.misc" : true, "spelling.able_atable" : true, "spelling.able_ible" : true, diff --git a/proselint/checks/redundancy/adverb_dialogue.py b/proselint/checks/redundancy/adverb_dialogue.py new file mode 100644 index 000000000..eddd66e49 --- /dev/null +++ b/proselint/checks/redundancy/adverb_dialogue.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +"""Redundancy.""" + +from proselint.tools import memoize, existence_check + + +@memoize +def check(text): + """Suggest the preferred forms.""" + err = "redundancy.adverb_dialogue" + msg = "Redundant adverb. Remove {}." + + regex = r'[\'"].*[,?!][\'"][\s\w]*?(\w+?ly)[\s\w]*[,.!?]' + + return existence_check(text, [regex], err, msg)