throws AnalysisEngineProcessException {
JFSIndexRepository indexes = jcas.getJFSIndexRepository();
Iterator wordItr = indexes.getAnnotationIndex(WordToken.type)
.iterator();
while (wordItr.hasNext()) {
WordToken wordAnnotation = (WordToken) wordItr.next();
if (wordAnnotation.getBegin() >= rangeBegin
&& wordAnnotation.getEnd() <= rangeEnd) {
String word = text.substring(wordAnnotation.getBegin(),
wordAnnotation.getEnd());
// if the original word was misspelled, use the spell correction
String suggestion = wordAnnotation.getSuggestion();
if ((suggestion != null) && (suggestion.length() > 0)) {
word = suggestion;
}