I like to use the present tense in my Git logs (for example, "Add feature" instead of "Added feature"). Currently, I have an extremely naive Git hook that aborts the commit if the first word of the log message ends in 'ed', but I'd like a more robust solution (where 'more robust' means 'not totally lame'). Is there a grammar checker that would give me the ability to write a script along the lines of:
echo $TEXT | check-grammar --present-tense || exit 1
I don't need a perfect solution, just something better than matching /^\w*ed\W/.
Grammarly is one of the most powerful grammar checkers. The free version will check for things like common use and subject/verb agreement, but does little with verb tense. However, with the paid version, you get a verb tense checker.
Verbs come in three tenses: past, present, and future. The past is used to describe things that have already happened (e.g., earlier in the day, yesterday, last week, three years ago). The present tense is used to describe things that are happening right now, or things that are continuous.
ProWritingAid's Grammar Check is like the spelling and grammar checkers in a word processor... but with superpowers. As well as highlighting misspelled words and missing punctuation, it also looks at the construction of the sentence to make sure that the structure, style, and tense are correct.
You might be able to use morpha for this purpose. Morpha is a lemmatizer that splits endings from base words, and then changes the base word to its uninflected form, which is conveniently the same as the underspecified third person singular in English.
As an example, the input 'added' would result in 'add+ed', meaning that you can even just prompt your exit command if the first word of the commit string has a plus sign in it, if you're looking for the most naive approach possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With