public FeatureStructure createFS(int addr, CASImpl cas) { if (Section_Type.this.useExistingInstance) { // Return eq fs instance if already created FeatureStructure fs = Section_Type.this.jcas.getJfsFromCaddr(addr); if (null == fs) { fs = new Section(addr, Section_Type.this); Section_Type.this.jcas.putJfsFromCaddr(addr, fs); return fs; } return fs; } else return new Section(addr, Section_Type.this); } };
static boolean extractReferencesNaively(JCas jCas) { // match potential sections List<Section> sections = newArrayList(); Matcher m = REFERENCES.matcher(jCas.getDocumentText()); while (m.find()) { Section section = new Section(jCas, m.start(), m.end()); section.setSectionType(BlueUima.SECTION_TYPE_REFERENCES); sections.add(section); } if (sections.size() == 1) { sections.get(0).addToIndexes(); return true; } return false; }