Package englishlanguage
Class Verb
- java.lang.Object
-
- englishlanguage.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull Verb
createOrRandom(java.lang.String word)
Factory.static @NotNull Verb
createRandom()
Factory.static @NotNull Verb
createVerb(java.lang.String word)
Factory.java.lang.String
getContent()
This method returns the content of the verb.
-
-
-
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 interfaceWord<java.lang.String>
- Returns:
- the content of the verb.
-
-