}
String acousticModelPath =
(args.length > 2) ? args[2] : ACOUSTIC_MODEL_PATH;
String dictionaryPath = (args.length > 3) ? args[3] : DICTIONARY_PATH;
String g2pPath = (args.length > 4) ? args[4] : null;
SpeechAligner aligner =
new SpeechAligner(acousticModelPath, dictionaryPath, g2pPath);
List<WordResult> results = aligner.align(audioUrl, transcript);
List<String> stringResults = new ArrayList<String>();
for (WordResult wr : results) {
stringResults.add(wr.getWord().getSpelling());
}
LongTextAligner textAligner =
new LongTextAligner(stringResults, 2);
List<String> words = aligner.getWordExpander().expand(transcript);
int[] aid = textAligner.align(words);
int lastId = -1;
for (int i = 0; i < aid.length; ++i) {