Package englishlanguage
Class Noun
- java.lang.Object
-
- englishlanguage.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull Noun
createNoun(@NotNull java.lang.String word)
Factory.static @NotNull Noun
createOrRandom(java.lang.String word)
Factory.static @NotNull Noun
createRandom()
Factory.java.lang.String
getContent()
Getter.
-
-
-
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 interfaceWord<java.lang.String>
- Returns:
- the noun that this class represents.
-
-