/** * Adds a tree to the container */ void add(Tree tree) { add(tree, null); }
public Topic newTopic(String value) { Topic newTopic = new Topic(value); annotationContainer.add(newTopic, Layer.TOPICS, AnnotationType.TOPIC); return newTopic; }
/** 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 Statement newStatement(String id, Statement.StatementTarget target) { idManager.updateCounter(AnnotationType.STATEMENT, id); Statement newStatement = new Statement(id, target); annotationContainer.add(newStatement, Layer.ATTRIBUTION, AnnotationType.STATEMENT); return newStatement; }
/** * 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; }
/** 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 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 String insertEntity(Entity entity) { String newId = idManager.entities.getNext(); entity.setId(newId); annotationContainer.add(entity); return newId; }
/** 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; }
public TLink newTLink(String id, TLinkReferable from, TLinkReferable to, String relType) { idManager.updateCounter(AnnotationType.TLINK, id); TLink newTLink = new TLink(id, from, to, relType); annotationContainer.add(newTLink, Layer.TEMPORAL_RELATIONS, AnnotationType.TLINK); return newTLink; }
public CLink newCLink(String id, Predicate from, Predicate to) { idManager.updateCounter(AnnotationType.CLINK, id); CLink newCLink = new CLink(id, from, to); annotationContainer.add(newCLink, Layer.CAUSAL_RELATIONS, AnnotationType.CLINK); return newCLink; }
/** 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 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.updateCounter(AnnotationType.OPINION, id); Opinion newOpinion = new Opinion(id); annotationContainer.add(newOpinion, Layer.OPINIONS, AnnotationType.OPINION); return newOpinion; }
/** Creates a new relation between entities and/or sentiment features. It receives its ID as an argument. The relation is added to the document. * @param id the ID of the relation * @param from source of the relation * @param to target of the relation * @return a new relation */ public Relation newRelation(String id, Relational from, Relational to) { idManager.updateCounter(AnnotationType.RELATION, id); Relation newRelation = new Relation(id, from, to); annotationContainer.add(newRelation, Layer.RELATIONS, AnnotationType.RELATION); return newRelation; }
/** * 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 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.predicates.getNext(); Predicate newPredicate = new Predicate(newId, span); annotationContainer.add(newPredicate); return newPredicate; }
public String insertCoref(Coref coref) { String newId = idManager.corefs.getNext(); coref.setId(newId); annotationContainer.add(coref); return newId; }
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); }