|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.process.Americanize
public class Americanize
Takes a HasWord or String and returns an Americanized version of it. Optionally, it does some month/day name normalization to capitalized. 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. to expand this list, we should probably look at:
http://wordlist.sourceforge.net/
or
http://home.comcast.net/~helenajole/Harry.html
.
Field Summary | |
---|---|
static int |
DONT_CAPITALIZE_TIMEX
|
Constructor Summary | |
---|---|
Americanize()
|
|
Americanize(int flags)
Make an object for Americanizing spelling. |
Method Summary | |
---|---|
static java.lang.String |
americanize(java.lang.String str)
Convert the spelling of a word from British to American English. |
static java.lang.String |
americanize(java.lang.String str,
boolean capitalizeTimex)
Convert the spelling of a word from British to American English. |
HasWord |
apply(HasWord w)
Americanize the HasWord or String coming in. |
static void |
main(java.lang.String[] args)
Americanize and print the command line arguments. |
static void |
setStaticCapitalizeTimex(boolean capitalizeTimex)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DONT_CAPITALIZE_TIMEX
Constructor Detail |
---|
public Americanize()
public Americanize(int flags)
flags
- An integer representing bit flags. At present the only
recognized flag is DONT_CAPITALIZE_TIMEX = 1 which suppresses
capitalization of days of the week and monthsMethod Detail |
---|
public HasWord apply(HasWord w)
apply
in interface Function<HasWord,HasWord>
w
- A HasWord or String to covert to American if needed.
public static java.lang.String americanize(java.lang.String str)
str
- The String to be Americanized
public static java.lang.String americanize(java.lang.String str, boolean capitalizeTimex)
str
- The String to be AmericanizedcapitalizeTimex
- Whether to capitalize time expressions like month names in return value
public static void setStaticCapitalizeTimex(boolean capitalizeTimex)
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
args
- Command line arguments: a list of words
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |