Class Noun

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

    public class Noun
    extends java.lang.Object
    implements Word<java.lang.String>
    The main feature of this class is to store internally (as a String) an english noun. 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

        @NotNull
        public static @NotNull Noun createRandom()
        Factory. Creates a random Noun object.
        Returns:
        A Noun object. This object contains a random noun as "noun" instance variable.
      • createNoun

        @Contract("_ -> new")
        @NotNull
        public static @NotNull Noun createNoun​(@NotNull
                                               @NotNull java.lang.String word)
        Factory. Creates a Noun.
        Parameters:
        word - to be verified if it really is a noun.
        Returns:
        A Noun object. This object will contain a noun if the noun provided is really a noun.
      • createOrRandom

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

        public java.lang.String getContent()
        Getter.
        Specified by:
        getContent in interface Word<java.lang.String>
        Returns:
        the noun that this class represents.