Iterator suffixTokenItr = suffixTokenSet.iterator();
while (suffixTokenItr.hasNext())
{
SuffixStrengthToken mt = (SuffixStrengthToken) suffixTokenItr.next();
SuffixStrengthAnnotation ma = new SuffixStrengthAnnotation(jcas, mt.getStartOffset(), mt.getEndOffset());
ma.addToIndexes();
}
// This needs to be handled differently. But since I'm not sure if this feature will be utilized
// I am going to leave 'as is' for now.
Set routeTokenSet = iv_routeFSM.execute(baseTokenList);
boolean foundRoute = false;
Iterator routeTokenItr = routeTokenSet.iterator();
int begSegRT = 0, endSegRT = 0;
while (routeTokenItr.hasNext())
{
RouteToken mt = (RouteToken) routeTokenItr.next();
begSegRT = mt.getStartOffset();
endSegRT = mt.getEndOffset();
RouteAnnotation ma = new RouteAnnotation(jcas, begSegRT, endSegRT);
ma.setIntakeMethod(new Integer(mt.getFormMethod()).toString());
ma.addToIndexes();
}
Set frequencyUnitTokenSet = iv_frequencyUnitFSM.execute(baseTokenList);
boolean foundFrequencyUnit = false;
Iterator frequencyUnitTokenItr = frequencyUnitTokenSet.iterator();
int begSegFUT = 0, endSegFUT = 0;
while (frequencyUnitTokenItr.hasNext())
{
FrequencyUnitToken fut = (FrequencyUnitToken) frequencyUnitTokenItr.next();
begSegFUT = fut.getStartOffset();
endSegFUT = fut.getEndOffset();
FrequencyUnitAnnotation ma = new FrequencyUnitAnnotation(jcas,
begSegFUT, endSegFUT);
ma.setPeriod(new Float(fut.getFrequencyUnitQuantity()).floatValue());
ma.addToIndexes();
}
// The frequencyFSM can take advantage of the frequencyUnit to
// establish conditions via the override
Set frequencyTokenSet = iv_frequencyFSM.execute(baseTokenList,
frequencyUnitTokenSet, rangeTokenSet);
boolean foundFrequency = false;
Iterator frequencyTokenItr = frequencyTokenSet.iterator();
int begSegFT = 0, endSegFT = 0;
while (frequencyTokenItr.hasNext())
{
FrequencyToken ft = (FrequencyToken) frequencyTokenItr.next();
begSegFT = ft.getStartOffset();
endSegFT = ft.getEndOffset();
FrequencyAnnotation ma = new FrequencyAnnotation(jcas, begSegFT,
endSegFT);
ma.addToIndexes();
}
/* Check again if confidence was found during frequency check */
Set durationTokenSet = iv_durationFSM.execute(baseTokenList,
rangeTokenSet);
Iterator durationTokenItr = durationTokenSet.iterator();
int begSegDU = 0, endSegDU = 0;
while (durationTokenItr.hasNext())
{
DurationToken du = (DurationToken) durationTokenItr.next();
begSegDU = du.getStartOffset();
endSegDU = du.getEndOffset();
DurationAnnotation ma = new DurationAnnotation(jcas, begSegDU, endSegDU);
// dm.setDurationElement(jcas, begSegDU, endSegDU);
ma.addToIndexes();
// loadandAppend("./frequencyTable.csv", ma.getCoveredText(),
// true);
}
} catch (Exception e)