proselint/checks/hyperbole/misc.py
raw| 1 | """Hyperbolic language. |
| 2 | |
| 3 | --- |
| 4 | layout: post |
| 5 | source: ??? |
| 6 | source_url: ??? |
| 7 | title: hyperbolic language |
| 8 | date: 2014-06-10 12:31:19 |
| 9 | categories: writing |
| 10 | --- |
| 11 | |
| 12 | Hyperbolic language. |
| 13 | |
| 14 | """ |
| 15 | from proselint.tools import existence_check, memoize |
| 16 | |
| 17 | |
| 18 | @memoize |
| 19 | def check(text): |
| 20 | """Check the text.""" |
| 21 | err = "hyperbolic.misc" |
| 22 | msg = "'{}' is hyperbolic." |
| 23 | |
| 24 | words = [ |
| 25 | r"[a-z]*[!]{2,}", |
| 26 | r"[a-z]*\?{2,}" |
| 27 | ] |
| 28 | |
| 29 | return existence_check(text, words, err, msg) |