public class Morphology extends Object implements java.util.function.Function
java Morphology filename
. In this case, POS tags MUST be
separated from words by an underscore ("_").
Constructor and Description |
---|
Morphology() |
Morphology(Reader in)
Process morphologically words from a Reader.
|
Morphology(Reader in,
int flags) |
Modifier and Type | Method and Description |
---|---|
Object |
apply(Object in) |
String |
lemma(String word,
String tag) |
String |
lemma(String word,
String tag,
boolean lowercase) |
static String |
lemmaStatic(String word,
String tag,
boolean lowercase) |
static String |
lemmaStaticSynchronized(String word,
String tag,
boolean lowercase) |
WordLemmaTag |
lemmatize(WordTag wT)
Lemmatize returning a
WordLemmaTag . |
static WordLemmaTag |
lemmatizeStatic(WordTag wT) |
static void |
main(String[] args)
Run the morphological analyzer.
|
Word |
next() |
void |
stem(CoreLabel label)
Adds the LemmaAnnotation to the given CoreLabel.
|
void |
stem(CoreLabel label,
Class<? extends CoreAnnotation<String>> ann)
Adds annotation
ann to the given CoreLabel. |
String |
stem(String word) |
Word |
stem(Word w) |
static WordTag |
stemStatic(String word,
String tag)
Return a new WordTag which has the lemma as the value of word().
|
static WordTag |
stemStatic(WordTag wT)
Return a new WordTag which has the lemma as the value of word().
|
static WordTag |
stemStaticSynchronized(String word,
String tag) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
andThen, compose, identity
public Morphology()
public Morphology(Reader in)
in
- The Reader to read frompublic Morphology(Reader in, int flags)
public Word next() throws IOException
IOException
public void stem(CoreLabel label)
public void stem(CoreLabel label, Class<? extends CoreAnnotation<String>> ann)
ann
to the given CoreLabel.
Assumes that it has a TextAnnotation and PartOfSpeechAnnotation.public static WordTag stemStatic(String word, String tag)
public static String lemmaStaticSynchronized(String word, String tag, boolean lowercase)
public static WordTag stemStatic(WordTag wT)
public Object apply(Object in)
apply
in interface java.util.function.Function
public WordLemmaTag lemmatize(WordTag wT)
WordLemmaTag
.public static WordLemmaTag lemmatizeStatic(WordTag wT)
public static void main(String[] args) throws IOException
IOException