Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CLI grammar checker for determining tense

Tags:

git

nlp

grammar

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/.

like image 284
William Pursell Avatar asked Jul 27 '09 13:07

William Pursell


People also ask

Can Grammarly check for tense?

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.

How do you identify which tense it is?

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.

Does ProWritingAid have tense checker?

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.


1 Answers

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.

like image 156
Robert Elwell Avatar answered Sep 29 '22 04:09

Robert Elwell