public class DictionaryLemmatizer extends Object implements Lemmatizer
| Constructor and Description |
|---|
DictionaryLemmatizer(InputStream dictionary)
Construct a hashmap from the input tab separated dictionary.
|
| Modifier and Type | Method and Description |
|---|---|
Map<List<String>,List<String>> |
getDictMap()
Get the Map containing the dictionary.
|
List<List<String>> |
lemmatize(List<String> tokens,
List<String> posTags)
Generates a lemma tags for the word and postag returning the result in a list
of every possible lemma for each token and postag.
|
String[] |
lemmatize(String[] tokens,
String[] postags)
Generates lemmas for the word and postag returning the result in an array.
|
public DictionaryLemmatizer(InputStream dictionary) throws IOException
dictionary - the input dictionary via inputstreamIOExceptionpublic Map<List<String>,List<String>> getDictMap()
public String[] lemmatize(String[] tokens, String[] postags)
Lemmatizerlemmatize in interface Lemmatizertokens - an array of the tokenspostags - an array of the pos tagspublic List<List<String>> lemmatize(List<String> tokens, List<String> posTags)
Lemmatizerlemmatize in interface Lemmatizertokens - an array of the tokensposTags - an array of the pos tagsCopyright © 2017 The Apache Software Foundation. All rights reserved.