edu.northwestern.at.morphadorner.examples
Class AdornAString

java.lang.Object
  extended by edu.northwestern.at.morphadorner.examples.AdornAString

public class AdornAString
extends java.lang.Object

AdornAString: Adorn a string with parts of speech, lemmata, and standard spellings.

Usage:

java -Xmx256m edu.northwestern.at.morphadorner.example.AdornAString "Text to adorn."

where "Text to adorn." specifies one or more sentences of text to adorn with part of speech tags, lemmata, and standard spellings. The default tokenizer, sentence splitter, lexicons, part of speech tagger, lemmatizer, and spelling standardizer are used.

Example:

java -Xmx256m edu.northwestern.at.morphadorner.example.AdornAString "Mary had a little lamb. Its fleece was white as snow."


Field Summary
static java.lang.String lemmaSeparator
          Lemma separator character,
 
Constructor Summary
AdornAString()
           
 
Method Summary
static void adornText(java.lang.String[] args)
          Adorn text specified as a program parameter.
static void main(java.lang.String[] args)
          Main program.
static void setLemma(AdornedWord adornedWord, Lexicon lexicon, Lemmatizer lemmatizer, PartOfSpeechTags partOfSpeechTags, WordTokenizer spellingTokenizer)
          Get lemma for a word.
static void setStandardSpelling(AdornedWord adornedWord, SpellingStandardizer standardizer, PartOfSpeechTags partOfSpeechTags)
          Get standard spelling for a word.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lemmaSeparator

public static java.lang.String lemmaSeparator
Lemma separator character,

Constructor Detail

AdornAString

public AdornAString()
Method Detail

main

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

Parameters:
args - Program parameters.

adornText

public static void adornText(java.lang.String[] args)
                      throws java.lang.Exception
Adorn text specified as a program parameter.

Parameters:
args - The program parameters.

args[ 0 ] contains the text to adorn. The text may contain one or more sentences with punctuation.

Throws:
java.lang.Exception

setStandardSpelling

public static void setStandardSpelling(AdornedWord adornedWord,
                                       SpellingStandardizer standardizer,
                                       PartOfSpeechTags partOfSpeechTags)
Get standard spelling for a word.

Parameters:
adornedWord - The adorned word.
standardizer - The spelling standardizer.
partOfSpeechTags - The part of speech tags.

On output, sets the standard spelling field of the adorned word


setLemma

public static void setLemma(AdornedWord adornedWord,
                            Lexicon lexicon,
                            Lemmatizer lemmatizer,
                            PartOfSpeechTags partOfSpeechTags,
                            WordTokenizer spellingTokenizer)
Get lemma for a word.

Parameters:
adornedWord - The adorned word.
lexicon - The word lexicon.
lemmatizer - The lemmatizer.
partOfSpeechTags - The part of speech tags.
spellingTokenizer - Tokenizer for spelling.

On output, sets the lemma field of the adorned word We look in the word lexicon first for the lemma. If the lexicon does not contain the lemma, we use the lemmatizer.