public class DictionaryLemmatizer extends Object implements Lemmatizer
Constructor and Description |
---|
DictionaryLemmatizer(File dictionaryFile) |
DictionaryLemmatizer(InputStream dictionary)
Construct a hashmap from the input tab separated dictionary.
|
DictionaryLemmatizer(Path dictionaryFile) |
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 inputstreamIOException
public DictionaryLemmatizer(File dictionaryFile) throws IOException
IOException
public DictionaryLemmatizer(Path dictionaryFile) throws IOException
IOException
public Map<List<String>,List<String>> getDictMap()
public String[] lemmatize(String[] tokens, String[] postags)
Lemmatizer
lemmatize
in interface Lemmatizer
tokens
- an array of the tokenspostags
- an array of the pos tagspublic List<List<String>> lemmatize(List<String> tokens, List<String> posTags)
Lemmatizer
lemmatize
in interface Lemmatizer
tokens
- an array of the tokensposTags
- an array of the pos tagsCopyright © 2018 The Apache Software Foundation. All rights reserved.