List uimaMeetings = new ArrayList();
FSIndex meetingIndex = aJCas.getAnnotationIndex(Meeting.type);
FSIterator iter = meetingIndex.iterator();
while (iter.isValid()) {
Meeting meeting = (Meeting) iter.get();
// get span of text within 50 chars on either side of meeting
// (window size should probably be a config. param)
int begin = meeting.getBegin() - 50;
int end = meeting.getEnd() + 50;
if (begin < 0) {
begin = 0;
}
if (end > text.length()) {
end = text.length();
}
String window = text.substring(begin, end);
// look for UIMA acronyms within this window
StringTokenizer tokenizer = new StringTokenizer(window, " \t\n\r.<.>/?\";:[{]}\\|=+()!");
while (tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
// look up token in map to see if it is an acronym
if (mMap.get(token) != null) {
// create annotation
UimaMeeting annot = new UimaMeeting(aJCas, meeting.getBegin(), meeting.getEnd(), meeting
.getRoom(), meeting.getDate(), meeting.getStartTime(), meeting.getEndTime());
// Add annotation to a list, to be later added to the indexes.
// We need to do this because it's not allowed to add to an
// index that you're currently iterating over.
uimaMeetings.add(annot);
break;