/** * 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 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 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; }
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; }
/** 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 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; }
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 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; }
/** * Creates a WF object to load an existing word form. It receives the ID as an argument. The WF is added to the document object. * * @param id word form's ID. * @param form text of the word form itself. * @return a new word form. */ public WF newWF(String id, String form, int sent) { idManager.wfs.update(id); WF newWF = new WF(this.annotationContainer, id, form, sent); annotationContainer.add(newWF); return newWF; }
/** * Creates a new srl predicate. It receives its ID as an argument. The predicate is added to the document. * * @param id the ID of the predicate * @param span span containing the targets of the predicate * @return a new predicate */ public Predicate newPredicate(String id, Span<Term> span) { idManager.predicates.update(id); Predicate newPredicate = new Predicate(id, span); annotationContainer.add(newPredicate); return newPredicate; }
/** * Creates a new category. It receives it's ID as an argument. The category is added to the document. * * @param id the ID of the category. * @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 id, String lemma, List<Span<Term>> references) { idManager.categories.update(id); Feature newCategory = new Feature(id, lemma, references); annotationContainer.add(newCategory); return newCategory; }
/** * Creates a new property. It receives it's ID as an argument. The property is added to the document. * * @param id the ID of the property. * @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 id, String lemma, List<Span<Term>> references) { idManager.properties.update(id); Feature newProperty = new Feature(id, lemma, references); annotationContainer.add(newProperty); return newProperty; }
/** * Creates an Entity object to load an existing entity. It receives the ID as an argument. The entity is added to the document object. * * @param id the ID of the named entity. * @param type entity type. 8 values are posible: Person, Organization, Location, Date, Time, Money, Percent, Misc. * @param references it contains one or more span elements. A span can be used to reference the different occurrences of the same named entity in the document. If the entity is composed by multiple words, multiple target elements are used. * @return a new named entity. */ public Entity newEntity(String id, List<Span<Term>> references) { idManager.entities.update(id); Entity newEntity = new Entity(id, references); annotationContainer.add(newEntity); return newEntity; }
/** * 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.relations.update(id); Relation newRelation = new Relation(id, from, to); annotationContainer.add(newRelation); return newRelation; }
/** * Creates a Term object to load an existing term. It receives the ID as an argument. The Term is added to the document object. * * @param id term's ID. * @param type type of term. There are two types of term: open and close. * @param lemma the lemma of the term. * @param pos part of speech of the term. * @param wfs the list of word forms this term is formed by. * @return a new term. */ public Term newTerm(String id, Span<WF> span) { idManager.terms.update(id); Term newTerm = new Term(id, span, false); annotationContainer.add(newTerm); return newTerm; }
/** * 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, Span<WF> mentions, String type) { idManager.timex3s.update(id); Timex3 newTimex3 = new Timex3(id, type); newTimex3.setSpan(mentions); annotationContainer.add(newTimex3); return newTimex3; }
/** * Creates a chunk object to load an existing chunk. It receives it's ID as an argument. The Chunk is added to the document object. * * @param id chunk's ID. * @param head the chunk head. * @param phrase type of the phrase. * @param terms the list of the terms in the chunk. * @return a new chunk. */ public Chunk newChunk(String id, String phrase, Span<Term> span) { idManager.chunks.update(id); Chunk newChunk = new Chunk(id, span); newChunk.setPhrase(phrase); annotationContainer.add(newChunk); return newChunk; }