edu.stanford.nlp.process
Class Morphology

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

public class Morphology
extends java.lang.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 Morpha (main) with arguments. On creation Morphology reads a file that contains a list of verbs that have doubling of consonants and expects to find the file in /u/nlp/data/morph/verbstem.list, unless another file is passed into the constructor.

See Also:
Serialized Form

Constructor Summary
Morphology()
           
Morphology(java.io.Reader in)
           
Morphology(java.io.Reader in, java.lang.String verbFile)
          Process morphologically from a Reader, having loaded verbs with stem doubling from the file verbFile.
Morphology(java.lang.String filename)
           
Morphology(java.lang.String filename, java.lang.String verbFile)
           
 
Method Summary
 java.lang.Object apply(java.lang.Object in)
          Converts a T1 to a different T2.
static void main(java.lang.String[] args)
           
static java.lang.String mapTag(java.lang.String posTag)
           
 WordTag stem(java.lang.String word, java.lang.String oldTag)
           
 Word stem(Word w)
           
 WordTag stem(WordTag wT)
           
static WordTag stemStatic(java.lang.String word, java.lang.String oldTag)
           
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(java.io.Reader in)

Morphology

public Morphology(java.lang.String filename)

Morphology

public Morphology(java.io.Reader in,
                  java.lang.String verbFile)
Process morphologically from a Reader, having loaded verbs with stem doubling from the file verbFile.


Morphology

public Morphology(java.lang.String filename,
                  java.lang.String verbFile)
Method Detail

mapTag

public static java.lang.String mapTag(java.lang.String posTag)

stem

public Word stem(Word w)

stem

public WordTag stem(WordTag wT)

stem

public WordTag stem(java.lang.String word,
                    java.lang.String oldTag)

stemStatic

public static WordTag stemStatic(WordTag wT)

stemStatic

public static WordTag stemStatic(java.lang.String word,
                                 java.lang.String oldTag)

apply

public java.lang.Object apply(java.lang.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

main

public static void main(java.lang.String[] args)