edu.ucdenver.ccp.nlp.biolemmatizer
Class Americanize

java.lang.Object
  extended by edu.ucdenver.ccp.nlp.biolemmatizer.Americanize

public class Americanize
extends Object

Takes a String and returns an Americanized version of it based on a list of British-to-American spellings and some rules. This is deterministic spelling conversion, and so cannot deal with certain cases involving complex ambiguities, but it can do most of the simple case of English to American conversion.

The list and rules for handling British-to-American spellings is derived from: http://www.tysto.com/uk-us-spelling-list.html.

Author:
Original author: Christopher Manning; Modified and extended by Haibin Liu

Constructor Summary
Americanize()
          Constructor to load the British-to-American spelling mapping file
 
Method Summary
 String americanize(String str)
          Convert the spelling of a word from British to American English.
static String join(String[] s, String delimiter)
          static method to concatenate String items with a specified delimiter
static void main(String[] args)
          Americanize and print the command line arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Americanize

public Americanize()
Constructor to load the British-to-American spelling mapping file

Method Detail

americanize

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

Parameters:
str - The String to be Americanized
Returns:
The American spelling of the word.

join

public static final String join(String[] s,
                                String delimiter)
static method to concatenate String items with a specified delimiter

Parameters:
s -
delimiter -
Returns:
concatenated String items with a specified delimiter

main

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

Parameters:
args - Command line arguments: a list of words
Throws:
IOException


Copyright © 2013. All Rights Reserved.