/** * Adds a word form to the container */ void add(WF wf) { text.add(wf); //nextOffset += wf.getLength() + 1; this.indexBySent(wf, wf.getSent(), this.textIndexedBySent); }
/** * Adds a named entity to the container */ void add(Entity entity) { entities.add(entity); /* Index by terms */ for (Term term : entity.getTerms()) { indexAnnotation(entity, term.getId(), entitiesIndexedByTerm); } this.indexBySent(entity, entity.getSpans().get(0).getTargets().get(0).getSent(), this.entitiesIndexedBySent); }
/** * Adds a chunk to the container */ void add(Chunk chunk) { chunks.add(chunk); /* Index by terms */ for (Term term : chunk.getTerms()) { indexAnnotation(chunk, term.getId(), chunksIndexedByTerm); } this.indexBySent(chunk, chunk.getSpan().getTargets().get(0).getSent(), this.chunksIndexedBySent); }
/** * Adds a predicate to the container */ void add(Predicate predicate) { predicates.add(predicate); /* Index by terms */ for (Term term : predicate.getTerms()) { indexAnnotation(predicate, term.getId(), predicatesIndexedByTerm); } this.indexBySent(predicate, predicate.getSpan().getTargets().get(0).getSent(), this.predicatesIndexedBySent); }
void add(Term term, int index) { terms.add(index, term); for (WF wf : term.getWFs()) { indexAnnotation(term, wf.getId(), termsIndexedByWF); } if (!term.isComponent()) { this.indexBySent(term, term.getSent(), this.termsIndexedBySent); } }
/** * Adds a dependency to the container */ void add(Dep dep) { deps.add(dep); /* Index by 'from' and 'to' terms */ if (dep.getFrom() != null) { String tId = dep.getFrom().getId(); indexAnnotation(dep, tId, depsIndexedByTerm); } if (dep.getTo() != null) { String tId = dep.getTo().getId(); indexAnnotation(dep, tId, depsIndexedByTerm); } this.indexBySent(dep, dep.getFrom().getSent(), this.depsIndexedBySent); }