|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.process.Morphology
public class Morphology
Morphology computes the base form of English words, by removing just inflections (not derivational morphology). That is, it only does noun plurals, pronoun case, and verb endings, and not things like comparative adjectives or derived nominals. It is based on a finite-state transducer implemented by John Carroll et al., written in flex and publicly available. See: http://www.informatics.susx.ac.uk/research/nlp/carroll/morph.html . There are several ways of invoking Morphology. One is by calling the static methods WordTag stemStatic(String word, String tag) or WordTag stemStatic(WordTag wordTag). If we have created a Morphology object already we can use the methods WordTag stem(String word, string tag) or WordTag stem(WordTag wordTag).
Another way of using Morphology is to run it on an input file by runningjava Morphology filename
. In this case, POS tags must be
separated from words by an underscore ("_").
Constructor Summary | |
---|---|
Morphology()
|
|
Morphology(Reader in)
Process morphologically words from a Reader. |
|
Morphology(String filename)
|
Method Summary | |
---|---|
Object |
apply(Object in)
Converts a T1 to a different T2. |
WordLemmaTag |
lemmatize(WordTag wT)
Lemmatize returning a WordLemmaTag . |
static WordLemmaTag |
lemmatizeStatic(WordTag wT)
|
static void |
main(String[] args)
Run the morphological analyzer. |
Word |
next()
|
WordTag |
stem(String word,
String tag)
|
static WordTag |
stem(String word,
String tag,
edu.stanford.nlp.process.Morpha lexer,
boolean lowercase)
Lemmatize the word, being sensitive to the tag, using the passed in lexer. |
Word |
stem(Word w)
|
WordTag |
stem(WordTag wT)
|
static WordTag |
stemStatic(String word,
String tag)
Return a new WordTag which has the lemma as the value of word(). |
static WordTag |
stemStatic(String word,
String tag,
boolean lowercase)
|
static WordTag |
stemStatic(WordTag wT)
Return a new WordTag which has the lemma as the value of word(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Morphology()
public Morphology(Reader in)
public Morphology(String filename)
Method Detail |
---|
public Word next() throws IOException
IOException
public Word stem(Word w)
public WordTag stem(WordTag wT)
public WordTag stem(String word, String tag)
public static WordTag stem(String word, String tag, edu.stanford.nlp.process.Morpha lexer, boolean lowercase)
lowercase
- If this is true, words other than proper nouns will
be changed to all lowercase.public static WordTag stemStatic(String word, String tag)
public static WordTag stemStatic(String word, String tag, boolean lowercase)
public static WordTag stemStatic(WordTag wT)
public Object apply(Object in)
Function
apply
in interface Function
public WordLemmaTag lemmatize(WordTag wT)
WordLemmaTag
.
public static WordLemmaTag lemmatizeStatic(WordTag wT)
public static void main(String[] args) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |