/** 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.getNextId(AnnotationType.ROLE); Predicate.Role newRole = new Predicate.Role(newId, semRole, span); return newRole; }
public Mark newMark(Span<WF> span) { String newId = idManager.getNextId(AnnotationType.MARK); Mark newMark = new Mark(newId, span); annotationContainer.add(newMark, Layer.MARKABLES, AnnotationType.MARK); return newMark; }
public PredicateAnchor newPredicateAnchor(Span<Predicate> span) { String newId = idManager.getNextId(AnnotationType.PREDICATE_ANCHOR); PredicateAnchor newPredicateAnchor = new PredicateAnchor(newId, span); annotationContainer.add(newPredicateAnchor, Layer.TEMPORAL_RELATIONS, AnnotationType.PREDICATE_ANCHOR); return newPredicateAnchor; }
/** Creates a new category. It assigns an appropriate ID to it. The category is added to the document. * @param lemma the lemma of the category. * @param references different mentions (list of targets) to the same category. * @return a new coreference. */ public Feature newCategory(String lemma, List<Span<Term>> references) { String newId = idManager.getNextId(AnnotationType.CATEGORY); Feature newCategory = new Feature(newId, lemma, references); annotationContainer.add(newCategory, Layer.CATEGORIES, AnnotationType.CATEGORY); return newCategory; }
public NonTerminal newNonTerminal(String id, String label) { NonTerminal tn = new NonTerminal(id, label); String newEdgeId = idManager.getNextId(AnnotationType.EDGE); tn.setEdgeId(newEdgeId); return tn; }
/** 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.getNextId(AnnotationType.TIMEX3); Timex3 newTimex3 = new Timex3(newId, type); annotationContainer.add(newTimex3, Layer.TIME_EXPRESSIONS, AnnotationType.TIMEX3); return newTimex3; }
/** Creates a new property. It assigns an appropriate ID to it. The property is added to the document. * @param lemma the lemma of the property. * @param references different mentions (list of targets) to the same property. * @return a new coreference. */ public Feature newProperty(String lemma, List<Span<Term>> references) { String newId = idManager.getNextId(AnnotationType.PROPERTY); Feature newProperty = new Feature(newId, lemma, references); annotationContainer.add(newProperty, Layer.PROPERTIES, AnnotationType.PROPERTY); return newProperty; }
/** 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.getNextId(AnnotationType.COREF); Coref newCoref = new Coref(newId, mentions); annotationContainer.add(newCoref, Layer.COREFERENCES, AnnotationType.COREF); return newCoref; }
public TLink newTLink(TLinkReferable from, TLinkReferable to, String relType) { String newId = idManager.getNextId(AnnotationType.TLINK); TLink newTLink = new TLink(newId, from, to, relType); annotationContainer.add(newTLink, Layer.TEMPORAL_RELATIONS, AnnotationType.TLINK); return newTLink; }
/** Creates a new relation between entities and/or sentiment features. It assigns an appropriate ID to it. The relation is added to the document. * @param from source of the relation * @param to target of the relation * @return a new relation */ public Relation newRelation(Relational from, Relational to) { String newId = idManager.getNextId(AnnotationType.RELATION); Relation newRelation = new Relation(newId, from, to); annotationContainer.add(newRelation, Layer.RELATIONS, AnnotationType.RELATION); return newRelation; }
public Terminal newTerminal(String id, Span<Term> span) { Terminal tn = new Terminal(id, span); String newEdgeId = idManager.getNextId(AnnotationType.EDGE); tn.setEdgeId(newEdgeId); return tn; }
public CLink newCLink(Predicate from, Predicate to) { String newId = idManager.getNextId(AnnotationType.CLINK); CLink newCLink = new CLink(newId, from, to); annotationContainer.add(newCLink, Layer.CAUSAL_RELATIONS, AnnotationType.CLINK); return newCLink; }
/** 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.getNextId(AnnotationType.OPINION); Opinion newOpinion = new Opinion(newId); annotationContainer.add(newOpinion, Layer.OPINIONS, AnnotationType.OPINION); return newOpinion; }
/** Creates a new srl predicate. It assigns an appropriate ID to it. The predicate is added to the document. * @param span span containing all the targets of the predicate * @return a new predicate */ public Predicate newPredicate(Span<Term> span) { String newId = idManager.getNextId(AnnotationType.PREDICATE); Predicate newPredicate = new Predicate(newId, span); annotationContainer.add(newPredicate, Layer.SRL, AnnotationType.PREDICATE); return newPredicate; }
public Statement newStatement(Statement.StatementTarget target) { String newId = idManager.getNextId(AnnotationType.STATEMENT); Statement newStatement = new Statement(newId, target); annotationContainer.add(newStatement, Layer.ATTRIBUTION, AnnotationType.STATEMENT); return newStatement; }
public WF newWF(int offset, Integer length, String form, int sent) { String newId = idManager.getNextId(AnnotationType.WF); WF newWF = new WF(this.annotationContainer, newId, offset, length, form, sent); annotationContainer.add(newWF, Layer.TEXT, AnnotationType.WF); return newWF; }
public void addExistingAnnotation(Annotation ann, Layer layer, AnnotationType type) { if (isIdentifiableAnnotationType(type)) { String newId = idManager.getNextId(type); ((IdentifiableAnnotation) ann).setId(newId); } annotationContainer.add(ann, layer, type); }
public Term newTerm(Span<WF> span, boolean isComponent) { String newId = idManager.getNextId(AnnotationType.TERM); Term newTerm = new Term(newId, span, isComponent); if (!isComponent) { annotationContainer.add(newTerm, Layer.TERMS, AnnotationType.TERM); } addToWfTermIndex(newTerm.getSpan().getTargets(), newTerm); // Rodrirekin hitz egin hau kentzeko return newTerm; }