public class Americanize extends 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 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.
|
HasWord |
apply(HasWord w)
Americanize the HasWord or String coming in.
|
static void |
main(String[] args)
Americanize and print the command line arguments.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
andThen, compose, identity
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 HasWord apply(HasWord w)
apply
in interface java.util.function.Function<HasWord,HasWord>
w
- A HasWord or String to covert to American if needed.public static String americanize(String str)
str
- The String to be Americanizedpublic static String americanize(String str, boolean capitalizeTimex)
str
- The String to be AmericanizedcapitalizeTimex
- Whether to capitalize time expressions like month names in return valuepublic static void main(String[] args) throws IOException
args
- Command line arguments: a list of wordsIOException