Package com.gengoai.hermes
Class Document.AnnotationBuilder
- java.lang.Object
-
- com.gengoai.hermes.Document.AnnotationBuilder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Document.AnnotationBuilder
attribute(AttributeType type, Object value)
Sets the value of the given AttributeType on the new Annotation to the given value.Document.AnnotationBuilder
attributes(HString copy)
Adds attributes to this annotation by copying the attributes of another HString object.Document.AnnotationBuilder
attributes(Map<AttributeType<?>,?> map)
Adds multiple attributes to the annotationDocument.AnnotationBuilder
bounds(Span span)
Sets the bounds of this annotation from the given spanAnnotation
createAttached()
Creates the annotation and attaches it to the documentAnnotation
createDetached()
Creates the annotation associated, but not attached, to the documentDocument.AnnotationBuilder
from(@NonNull HString hString)
Sets the bounds, and adds the relations and attributes from the given HString to this builder.Document.AnnotationBuilder
relation(@NonNull Relation relation)
Adds the given relation.Document.AnnotationBuilder
relation(@NonNull Iterable<Relation> relations)
Adds the given iterable of relations.
-
-
-
Method Detail
-
attribute
public Document.AnnotationBuilder attribute(AttributeType type, Object value)
Sets the value of the given AttributeType on the new Annotation to the given value.- Parameters:
type
- the attribute typevalue
- the attribute value- Returns:
- this annotation builder
-
attributes
public Document.AnnotationBuilder attributes(Map<AttributeType<?>,?> map)
Adds multiple attributes to the annotation- Parameters:
map
- the map of attribute types and values- Returns:
- this annotation builder
-
attributes
public Document.AnnotationBuilder attributes(HString copy)
Adds attributes to this annotation by copying the attributes of another HString object.- Parameters:
copy
- the HString object whose attributes will be copied- Returns:
- this annotation builder
-
bounds
public Document.AnnotationBuilder bounds(Span span)
Sets the bounds of this annotation from the given span- Parameters:
span
- the span to use for the bounds of the annotation- Returns:
- this annotation builder
-
createAttached
public Annotation createAttached()
Creates the annotation and attaches it to the document- Returns:
- the annotation
-
createDetached
public Annotation createDetached()
Creates the annotation associated, but not attached, to the document- Returns:
- the annotation
-
from
public Document.AnnotationBuilder from(@NonNull @NonNull HString hString)
Sets the bounds, and adds the relations and attributes from the given HString to this builder.- Parameters:
hString
- The HString to copy from- Returns:
- This builder
-
relation
public Document.AnnotationBuilder relation(@NonNull @NonNull Relation relation)
Adds the given relation.- Parameters:
relation
- The relation to add- Returns:
- This builder
-
relation
public Document.AnnotationBuilder relation(@NonNull @NonNull Iterable<Relation> relations)
Adds the given iterable of relations.- Parameters:
relations
- The relations to add- Returns:
- This builder
-
-