medkit.core.text.entity_attribute_container
medkit.core.text.entity_attribute_container#
Classes:
|
Manage a list of attributes attached to a text entity. |
- class EntityAttributeContainer(owner_id)[source]#
Manage a list of attributes attached to a text entity.
This behaves more or less like a list: calling len() and iterating are supported. Additional filtering is available through the get() method.
Also provides retrieval of normalization attributes.
Attributes:
Return the list of normalization attributes
Methods:
add
(attr)Attach an attribute to the annotation.
get
(*[, label])Return a list of the attributes of the annotation, optionally filtering by label.
get_by_id
(uid)Return the attribute corresponding to a specific identifier.
Return a list of the normalization attributes of the annotation
- property norms: List[medkit.core.text.entity_norm_attribute.EntityNormAttribute]#
Return the list of normalization attributes
- Return type
List
[EntityNormAttribute
]
- add(attr)[source]#
Attach an attribute to the annotation.
- Parameters
attr (
Attribute
) – Attribute to add.- Raises
ValueError – If the attribute is already attached to the annotation (based on attr.uid).
- get_norms()[source]#
Return a list of the normalization attributes of the annotation
- Return type
List
[EntityNormAttribute
]