I'm working on a static analysis tool for the documentation in the Python programming language (PEP257). For this, I need to check if the first word in a documentation string is a verb in the imperative mood.
Our current check is that the word should not end with an "s", except if it ends with a double "s". So "Pass" is okay, but "Passes" is not. The problem with the current test is that it has false negatives, e.g., "Focus".
Is there a way to check for this? Assuming that the word is already a verb is fine. If the check can sometimes fail, I rather it failed on passing the test (concluding that a verb is in the imperative mood) than vice-versa.