} catch (URISyntaxException e1)
{
logger.log(Level.SEVERE, String.format("section regex file not found [%s]", sectionRegexFileUriString), e1);
throw new AnalysisEngineProcessException(e1);
}
ZonerCli zonerCli =
new ZonerCli(sectionRegexFileInClasspathUri);
zonerCli.setEntireContents(jcas.getDocumentText());
// initialize converter once contents are set
zonerCli.initialize();
try {
zonerCli.execute();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return;
//throw new AnalysisEngineProcessException(e);
} catch (StringIndexOutOfBoundsException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.format("string index out of bounds exception count: %d%n", ++countOfIndexOutOfBounds);
return;
//throw new AnalysisEngineProcessException(e);
}
// Add the zone annotations
List<Range> rangeList = zonerCli.getRangeList();
for (Iterator<Range> i = rangeList.iterator(); i.hasNext(); ) {
Range r = i.next();
Zone zAnnot = new Zone(jcas);
zAnnot.setBegin(r.getBegin());
zAnnot.setEnd(r.getEnd());
zAnnot.setLabel(r.getLabel());
zAnnot.addToIndexes();
logger.info(String.format("added new zone annotation [%d-%d] \"%s\"", zAnnot.getBegin(), zAnnot.getEnd(), zAnnot.getCoveredText()));
}
// List<Range> subsectionRangeList = zonerCli.getSubsections();
// for (Iterator<Range> i = subsectionRangeList.iterator(); i.hasNext(); ) {
// Range r = i.next();
// Subzone sAnnot = new Subzone(jcas);
// sAnnot.setBegin(r.getBegin());
// sAnnot.setEnd(r.getEnd());
// sAnnot.setLabel(r.getLabel());
// sAnnot.addToIndexes();
// logger.info(String.format("added new subzone annotation [%d-%d] \"%s\"", sAnnot.getBegin(), sAnnot.getEnd(), sAnnot.getCoveredText()));
// }
// Add the heading annotations
List<HeadingRange> headings = zonerCli.getHeadings();
for (Iterator<HeadingRange> i = headings.iterator(); i.hasNext(); ) {
HeadingRange r = i.next();
Heading hAnnot = new Heading(jcas);
hAnnot.setBegin(r.getHeadingBegin());
hAnnot.setEnd(r.getHeadingEnd());