Class Verb

  • All Implemented Interfaces:
    Word<java.lang.String>

    public class Verb
    extends java.lang.Object
    implements Word<java.lang.String>
    The main feature of this class is to store internally (as a String) an english verb. The idea of this class is to provide a short and easy way to classify a word in respect to english language. This could be used with the Markov Chains to create clearer random sentences and provide a good way to classify words.
    Since:
    1.0 SNAPSHOT
    Author:
    Arthur Brenno
    • Method Detail

      • createRandom

        @Contract(" -> new")
        @NotNull
        public static @NotNull Verb createRandom()
        Factory. Creates a random Verb object.
        Returns:
        A Verb object. This object contains a random verb as "verb" instance variable.
      • createVerb

        @Contract("_ -> new")
        @NotNull
        public static @NotNull Verb createVerb​(java.lang.String word)
        Factory. Creates a Verb object if the input is valid.
        Parameters:
        word - to be verified.
        Returns:
        A Verb object. This object will contain a verb if the verb provided is really a verb.
        Throws:
        java.lang.RuntimeException - if the verb provided is not a verb.
      • createOrRandom

        @Contract("_ -> new")
        @NotNull
        public static @NotNull Verb createOrRandom​(java.lang.String word)
        Factory. Creates a verb by the input or a random verb.
        Parameters:
        word - to be verified.
        Returns:
        Verb instance.
      • getContent

        public java.lang.String getContent()
        This method returns the content of the verb.
        Specified by:
        getContent in interface Word<java.lang.String>
        Returns:
        the content of the verb.