edu.stanford.nlp.process
Class Americanize

java.lang.Object
  extended byedu.stanford.nlp.process.Americanize
All Implemented Interfaces:
Function

public class Americanize
extends Object
implements Function

Takes a HasWord or String and returns a lowercase version of it. This is deterministic spelling coversion, and so cannot deal with certain cases involving complex ambiguities, but it can do most of the simple case of English to American conversion. This list is still quite incomplete, but does some of the commenest cases found when running our parser or doing biomedical processing.

Author:
Christopher Manning

Field Summary
static int CAPITALIZE_TIMEX
           
 
Constructor Summary
Americanize()
           
Americanize(int flags)
           
 
Method Summary
static String americanize(String str)
          Convert the spelling of a word from British to American English.
static String americanize(String str, boolean capitalizeTimex)
          Convert the spelling of a word from British to American English.
 Object apply(Object in)
          Americanize the HasWord or String coming in.
static void main(String[] args)
          Americanize and print the command line arguments.
 void setStaticCapitalizeTimex(boolean capitalizeTimex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAPITALIZE_TIMEX

public static final int CAPITALIZE_TIMEX
See Also:
Constant Field Values
Constructor Detail

Americanize

public Americanize()

Americanize

public Americanize(int flags)
Method Detail

apply

public Object apply(Object in)
Americanize the HasWord or String coming in.

Specified by:
apply in interface Function
Parameters:
in - A HasWord or String to covert to American if needed.
Returns:
Either the input or an Americanized version of it.

americanize

public static String americanize(String str)
Convert the spelling of a word from British to American English. This is deterministic spelling coversion, and so cannot deal with certain cases involving complex ambiguities, but it can do most of the simple case of English to American conversion.


americanize

public static String americanize(String str,
                                 boolean capitalizeTimex)
Convert the spelling of a word from British to American English. This is deterministic spelling coversion, and so cannot deal with certain cases involving complex ambiguities, but it can do most of the simple case of English to American conversion.


setStaticCapitalizeTimex

public void setStaticCapitalizeTimex(boolean capitalizeTimex)

main

public static void main(String[] args)
Americanize and print the command line arguments. This main method is just for debugging.



Stanford NLP Group