public static String trimWord(final String word){
  String tempword=word.toLowerCase();
  while (tempword.length() > 0) {
    final char c=tempword.charAt(0);
    if (c == '\'') {
      tempword=tempword.substring(1);
    }
 else {
      break;
    }
  }
  while (tempword.length() > 0) {
    final char c=tempword.charAt(tempword.length() - 1);
    if (c == '\'') {
      tempword=tempword.substring(0,tempword.length() - 1);
    }
 else {
      break;
    }
  }
  return tempword;
}

public static String trimWord ( final String word ) { String tempword = word . toLowerCase ( ) ; while ( tempword . length ( ) > 0 ) { final char c = tempword . charAt ( 0 ) ; if ( c == '\'' ) { tempword = tempword . substring ( 1 ) ; } else { break ; } } while ( tempword . length ( ) > 0 ) { final char c = tempword . charAt ( tempword . length ( ) - 1 ) ; if ( c == '\'' ) { tempword = tempword . substring ( 0 , tempword . length ( ) - 1 ) ; } else { break ; } } return tempword ; }
transform the given word to lower case and trim special characters at beginning and end to use this normalized form as key in the word list .
