edu.stanford.nlp.process
Class Morphology

java.lang.Object
  extended by edu.stanford.nlp.process.Morphology
All Implemented Interfaces:
Function, Serializable

public class Morphology
extends Object
implements Function

Morphology computes the base form of English words, by removing just inflections (not derivational morphology). It is based on a finite-state transducer implemented by John Carroll et al., written in flex and publicly available. 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 running java Morphology filename

Author:
Kristina Toutanova (kristina@cs.stanford.edu), Christopher Manning
See Also:
Serialized Form

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)
           
 Word next()
           
 WordTag stem(String word, String oldTag)
           
static WordTag stem(String word, String oldTag, edu.stanford.nlp.process.Morpha lexer)
           
 Word stem(Word w)
           
 WordTag stem(WordTag wT)
           
static WordTag stemStatic(String word, String tag)
           
static WordTag stemStatic(WordTag wT)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Morphology

public Morphology()

Morphology

public Morphology(Reader in)
Process morphologically words from a Reader.


Morphology

public Morphology(String filename)
Method Detail

next

public Word next()
          throws IOException
Throws:
IOException

stem

public Word stem(Word w)

stem

public WordTag stem(WordTag wT)

stem

public WordTag stem(String word,
                    String oldTag)

stem

public static WordTag stem(String word,
                           String oldTag,
                           edu.stanford.nlp.process.Morpha lexer)

stemStatic

public static WordTag stemStatic(String word,
                                 String tag)

stemStatic

public static WordTag stemStatic(WordTag wT)

apply

public Object apply(Object in)
Description copied from interface: Function
Converts a T1 to a different T2. For example, a Parser will convert a Sentence to a Tree. A Tagger will convert a Sentence to a TaggedSentence.

Specified by:
apply in interface Function

lemmatize

public WordLemmaTag lemmatize(WordTag wT)
Lemmatize returning a WordLemmaTag .


lemmatizeStatic

public static WordLemmaTag lemmatizeStatic(WordTag wT)

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Stanford NLP Group