Package com.gengoai.hermes.en
Class ENLemmatizer
- java.lang.Object
-
- com.gengoai.hermes.en.ENLemmatizer
-
- All Implemented Interfaces:
Lemmatizer
,Serializable
public class ENLemmatizer extends Object implements Lemmatizer, Serializable
English language lemmatizer based on WordNet's Morphy- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
allPossibleLemmas(@NonNull String word, @NonNull PartOfSpeech partOfSpeech)
Gets all lemmas.Trie<String>
allPossibleLemmasAndPrefixes(@NonNull String string, @NonNull PartOfSpeech partOfSpeech)
Gets prefixed lemmas.boolean
canLemmatize(String input, PartOfSpeech partOfSpeech)
Can lemmatize boolean.static ENLemmatizer
getInstance()
String
lemmatize(@NonNull String string, @NonNull PartOfSpeech partOfSpeech)
Determines the best lemma for a string given a part of speech-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.gengoai.hermes.morphology.Lemmatizer
lemmatize, lemmatize
-
-
-
-
Method Detail
-
getInstance
public static ENLemmatizer getInstance()
- Returns:
- the singleton instance of the Lemmatizer
-
allPossibleLemmas
public List<String> allPossibleLemmas(@NonNull @NonNull String word, @NonNull @NonNull PartOfSpeech partOfSpeech)
Description copied from interface:Lemmatizer
Gets all lemmas.- Specified by:
allPossibleLemmas
in interfaceLemmatizer
- Parameters:
word
- the stringpartOfSpeech
- the part of speech- Returns:
- the all lemmas
-
allPossibleLemmasAndPrefixes
public Trie<String> allPossibleLemmasAndPrefixes(@NonNull @NonNull String string, @NonNull @NonNull PartOfSpeech partOfSpeech)
Description copied from interface:Lemmatizer
Gets prefixed lemmas.- Specified by:
allPossibleLemmasAndPrefixes
in interfaceLemmatizer
- Parameters:
string
- the stringpartOfSpeech
- the part of speech- Returns:
- the prefixed lemmas
-
canLemmatize
public boolean canLemmatize(String input, PartOfSpeech partOfSpeech)
Description copied from interface:Lemmatizer
Can lemmatize boolean.- Specified by:
canLemmatize
in interfaceLemmatizer
- Parameters:
input
- the inputpartOfSpeech
- the part of speech- Returns:
- the boolean
-
lemmatize
public String lemmatize(@NonNull @NonNull String string, @NonNull @NonNull PartOfSpeech partOfSpeech)
Description copied from interface:Lemmatizer
Determines the best lemma for a string given a part of speech- Specified by:
lemmatize
in interfaceLemmatizer
- Parameters:
string
- the stringpartOfSpeech
- the part of speech- Returns:
- the lemmatized version of the string
-
-