Class VerbService


  • public final class VerbService
    extends java.lang.Object
    Provides methods to classify words. It is necessary because there's a need to check if a word is or not a verb, in addition to having a whole verbs dataset to power up the text generation at its maximum. It was chosen to be a Singleton because there is no need to have another instance of this class in an application.
    Since:
    1.0 SNAPSHOT
    Author:
    Arthur Brenno
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Set<java.lang.String> commonVerbs()
      Getter.
      static java.lang.String getRandom()
      Gets a random verb based on the most common verbs of the english language.
      static boolean isVerb​(@NotNull java.lang.String word)
      Checks if a word is a verb
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • commonVerbs

        public static java.util.Set<java.lang.String> commonVerbs()
        Getter.
        Returns:
        commonVerbs instance variable (HashSet).
      • isVerb

        public static boolean isVerb​(@NotNull
                                     @NotNull java.lang.String word)
        Checks if a word is a verb
        Parameters:
        word - to be checked.
        Returns:
        true if the word is a verb, false otherwise.
      • getRandom

        public static java.lang.String getRandom()
        Gets a random verb based on the most common verbs of the english language.
        Returns:
        the random verb.