public Object apply(Object in){
  if (in instanceof HasWord) {
    HasWord w=(HasWord)in;
    String str=w.word();
    String outStr=americanize(str,capitalizeTimex);
    if (!outStr.equals(str)) {
      w.setWord(outStr);
    }
    return w;
  }
 else {
    String str=(String)in;
    return americanize(str,capitalizeTimex);
  }
}

public Object apply ( Object in ) { if ( in instanceof HasWord ) { HasWord w = ( HasWord ) in ; String str = w . word ( ) ; String outStr = americanize ( str , capitalizeTimex ) ; if ( ! outStr . equals ( str ) ) { w . setWord ( outStr ) ; } return w ; } else { String str = ( String ) in ; return americanize ( str , capitalizeTimex ) ; } }
americanize the hasword or string coming in .
