/**
     * utility function to convert text string into canonical-format word array
     *
     * @param text -- text string including punctuation
     */
public static String[] textToWords(String text) {
        // TODO: strip word-final or -initial apostrophes as in James' or 'cause.
        // Currently assuming hyphenated expressions split into two Asr words.
        return text.replace('-', ' ').replaceAll("['.!?,:;\"\\(\\)]", " ").toUpperCase(Locale.US).trim().split("\\s+");
    }
public static String[] textToWords(String text) {
// TODO: strip word-final or -initial apostrophes as in James' or 'cause.
// Currently assuming hyphenated expressions split into two Asr words.
return text.replace('-', ' ').replaceAll("['.!?,:;\"\\(\\)]", " ").toUpperCase(Locale.US).trim().split("\\s+");
}
public static String[] textToWords(String text) {
// TODO: strip word-final or -initial apostrophes as in James' or 'cause.
// Currently assuming hyphenated expressions split into two Asr words.
return text.replace('-', ' ').replaceAll("['.!?,:;\"\\(\\)]", " ").toUpperCase(Locale.US).trim().split("\\s+");
}
public static String[] textToWords(String text) {
// TODO: strip word-final or -initial apostrophes as in James' or 'cause.
// Currently assuming hyphenated expressions split into two Asr words.
return text.replace('-', ' ').replaceAll("['.!?,:;\"\\(\\)]", " ").toUpperCase(Locale.US).trim().split("\\s+");
}