tokenList.clear();
wordList.clear();
FSIterator tokenIterator = tokenIndex.subiterator(sentence);
while (tokenIterator.hasNext()) {
TokenAnnotation token = (TokenAnnotation) tokenIterator.next();
tokenList.add(token);
wordList.add(token.getCoveredText());
}
List<String> wordTagList = Viterbi.process(this.N, wordList, this.my_model.suffix_tree, this.my_model.suffix_tree_capitalized, this.my_model.transition_probs,
this.my_model.word_probs, this.my_model.lambdas2, this.my_model.lambdas3, this.my_model.theta);
try {
for (int i = 0; i < tokenList.size(); i++) {
Annotation token = tokenList.get(i);
String posTag = wordTagList.get(i);
Feature featPOS = getType(workingView, this.theTokenTypeName).getFeatureByBaseName(thePOSAttribute);
token.setFeatureValueFromString(featPOS, posTag);
}
} catch (IndexOutOfBoundsException e) {
System.err.println("POS tagger error - list of tags shorter than list of words");
}