public void update(String id) { try { Integer idNum = extractCounterFromId(id); if (counter < idNum) { counter = idNum; } } catch (IllegalStateException e) { inconsistent = true; } }
void updateComponentCounter(String id, String termId) { int componentInd; Matcher matcher = Pattern.compile("^" + terms.getPrefix() + "_?\\d+\\" + COMPONENT_PREFIX + "(\\d+)$").matcher(id); if (!matcher.find()) { this.inconsistentIdComponent = true; return; } componentInd = Integer.valueOf(matcher.group(1)); componentCounter.put(termId, componentInd); }
/** * Creates a Role object to load an existing role. It receives the ID as an argument. It doesn't add the role to the predicate. * * @param id role's ID. * @param predicate the predicate which this role is part of * @param semRole semantic role * @param span span containing all the targets of the role * @return a new role. */ public Predicate.Role newRole(String id, Predicate predicate, String semRole, Span<Term> span) { idManager.roles.update(id); Predicate.Role newRole = new Predicate.Role(id, semRole, span); return newRole; }
public Term newTerm(String id, Span<WF> span, Integer position) { idManager.terms.update(id); Term newTerm = new Term(id, span, false); annotationContainer.add(newTerm, position); return newTerm; }
public Term newTerm(String id, Span<WF> span, boolean isComponent) { idManager.terms.update(id); Term newTerm = new Term(id, span, isComponent); if (!isComponent) { annotationContainer.add(newTerm); } return newTerm; }
/** * Creates a new Role object. It assigns an appropriate ID to it. It uses the ID of the predicate to create a new ID for the role. It doesn't add the role to the predicate. * * @param predicate the predicate which this role is part of * @param semRole semantic role * @param span span containing all the targets of the role * @return a new role. */ public Predicate.Role newRole(Predicate predicate, String semRole, Span<Term> span) { String newId = idManager.roles.getNext(); Predicate.Role newRole = new Predicate.Role(newId, semRole, span); return newRole; }
public TLink newTLink(String id, TLinkReferable from, TLinkReferable to, String relType) { idManager.tlinks.update(id); TLink newTLink = new TLink(id, from, to, relType); annotationContainer.add(newTLink); return newTLink; }
/** * Creates a new coreference. It assigns an appropriate ID to it. The Coref is added to the document. * * @param references different mentions (list of targets) to the same entity. * @return a new coreference. */ public Coref newCoref(List<Span<Term>> mentions) { String newId = idManager.corefs.getNext(); Coref newCoref = new Coref(newId, mentions); annotationContainer.add(newCoref); return newCoref; }
public CLink newCLink(String id, Predicate from, Predicate to) { idManager.clinks.update(id); CLink newCLink = new CLink(id, from, to); annotationContainer.add(newCLink); return newCLink; }
/** Creates a new timeExpressions. It assigns an appropriate ID to it. The Coref is added to the document. * @param references different mentions (list of targets) to the same entity. * @return a new timex3. */ public Timex3 newTimex3(String type) { String newId = idManager.timex3s.getNext(); Timex3 newTimex3 = new Timex3(newId, type); annotationContainer.add(newTimex3); return newTimex3; }
/** * Creates a new opinion object. It receives its ID as an argument. The opinion is added to the document. * * @return a new opinion. */ public Opinion newOpinion(String id) { idManager.opinions.update(id); Opinion newOpinion = new Opinion(id); annotationContainer.add(newOpinion); return newOpinion; }
/** * Creates a new opinion object. It assigns an appropriate ID to it. The opinion is added to the document. * * @return a new opinion. */ public Opinion newOpinion() { String newId = idManager.opinions.getNext(); Opinion newOpinion = new Opinion(newId); annotationContainer.add(newOpinion); return newOpinion; }
public Mark newMark(String id, String source, Span<Term> span) { idManager.marks.update(id); Mark newMark = new Mark(id, span); annotationContainer.add(newMark, source); return newMark; }
public String insertEntity(Entity entity) { String newId = idManager.entities.getNext(); entity.setId(newId); annotationContainer.add(entity); return newId; }
/** Creates a timeExpressions object to load an existing Timex3. It receives it's ID as an argument. The Timex3 is added to the document. * @param id the ID of the coreference. * @param references different mentions (list of targets) to the same entity. * @return a new timex3. */ public Timex3 newTimex3(String id, String type) { idManager.timex3s.update(id); Timex3 newTimex3 = new Timex3(id, type); annotationContainer.add(newTimex3); return newTimex3; }
public String insertWF(WF wf) { String newId = idManager.wfs.getNext(); wf.setId(newId); annotationContainer.add(wf); return newId; }
/** * Creates a coreference object to load an existing Coref. It receives it's ID as an argument. The Coref is added to the document. * * @param id the ID of the coreference. * @param references different mentions (list of targets) to the same entity. * @return a new coreference. */ public Coref newCoref(String id, List<Span<Term>> mentions) { idManager.corefs.update(id); Coref newCoref = new Coref(id, mentions); annotationContainer.add(newCoref); return newCoref; }
public String insertChunk(Chunk chunk) { String newId = idManager.chunks.getNext(); chunk.setId(newId); annotationContainer.add(chunk); return newId; }