Package englishlanguage.services
Class AdjectiveService
- java.lang.Object
-
- englishlanguage.services.AdjectiveService
-
public final class AdjectiveService 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 an adjective, in addition to having a whole adjectives' dataset to power up the text generation at its maximum. It was chosen to be static 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>
commonAdjectives()
Getter.static java.lang.String
getRandom()
Gets a random adjective from the adjective dataset.static boolean
isAdjective(@NotNull java.lang.String word)
Checks if a word is an adjective.
-
-
-
Method Detail
-
commonAdjectives
public static java.util.Set<java.lang.String> commonAdjectives()
Getter.- Returns:
- the "commonAdjectives" instance variable (HashSet).
-
isAdjective
public static boolean isAdjective(@NotNull @NotNull java.lang.String word)
Checks if a word is an adjective.- Parameters:
word
- to be checked (will be converted to lower-case).- Returns:
- true if it is an adjective, false if it's not.
-
getRandom
public static java.lang.String getRandom()
Gets a random adjective from the adjective dataset.- Returns:
- the random adjective.
-
-