code: public static String americanize(String str, boolean capitalizeTimex) {
      // System.err.println("str is |" + str + "|");
      // System.err.println("timexMapping.contains is " +
      //            timexMapping.containsKey(str));
      if (capitalizeTimex && timexMapping.containsKey(str)) {
        return timexMapping.get(str);
      } else if (mapping.containsKey(str)) {
        return mapping.get(str);
      } else {
        for (int i = 0; i < pats.length; i++) {
          Pattern ex = excepts[i];
          if (ex != null) {
            Matcher me = ex.matcher(str);
            if (me.find()) {
              continue;
            }
          }
          Matcher m = pats[i].matcher(str);
          if (m.find()) {
            // System.err.println("Replacing " + word + " with " +
            //             pats[i].matcher(word).replaceAll(reps[i]));
            return m.replaceAll(reps[i]);
          }
        }
        return str;
      }
    }
docs: 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.
  
  @param str The String to be Americanized
  @param capitalizeTimex Whether to capitalize time expressions like month names in return value
  @return The American spelling of the word.