public class Americanize extends java.lang.Object implements java.util.function.Function<HasWord,HasWord>
This list is still quite incomplete, but does some of the
most common 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
.
Modifier and Type | Field and Description |
---|---|
static int |
DONT_CAPITALIZE_TIMEX |
Constructor and Description |
---|
Americanize() |
Americanize(int flags)
Make an object for Americanizing spelling.
|
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
toString() |
public static final int DONT_CAPITALIZE_TIMEX
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 months.public static java.lang.String americanize(java.lang.String str)
str
- The String to be Americanizedpublic 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 valuepublic java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args) throws java.io.IOException
args
- Command line arguments: a list of wordsjava.io.IOException