/** Creates a new Entity. It assigns an appropriate ID to it. The entity is added to the document object. * @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(List<Span<Term>> references) { String newId = idManager.getNextId(AnnotationType.ENTITY); Entity newEntity = new Entity(newId, references); annotationContainer.add(newEntity, Layer.ENTITIES, AnnotationType.ENTITY); return newEntity; }
/** 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.updateCounter(AnnotationType.ENTITY, id); Entity newEntity = new Entity(id, references); annotationContainer.add(newEntity, Layer.ENTITIES, AnnotationType.ENTITY); return newEntity; }
/** * Creates a new Entity. It assigns an appropriate ID to it. The entity is added to the document object. * * @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(List<Span<Term>> references) { String newId = idManager.entities.getNext(); Entity newEntity = new Entity(newId, references); annotationContainer.add(newEntity); return newEntity; }
/** * 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; }
Entity entityCopy = new Entity(entity, copiedTerms); kaf.insertEntity(entityCopy); copiedRelationals.put(entity.getId(), entityCopy);
Entity entityCopy = new Entity(entity, copiedTerms); this.insertEntity(entityCopy); copiedRelationals.put(entity.getId(), entityCopy);