(sentence)
| 26 | # because the parses sometimes tags infinitive "do" incorrectly. |
| 27 | |
| 28 | def imperative(sentence): |
| 29 | for p in ("!could|!would|!should|!to+ VB", "^VB", "^do|VB*"): |
| 30 | m = match(p, sentence) |
| 31 | if match(p, sentence) and sentence.string.endswith((".","!")): # Exclude questions. |
| 32 | return True |
| 33 | return False |
| 34 | |
| 35 | for s in ( |
| 36 | "Just stop it!", |
no test coverage detected
searching dependent graphs…