medkit.core.text.entity_attribute_container#

Classes#

EntityAttributeContainer

Manage a list of attributes attached to a text entity.

Module Contents#

class medkit.core.text.entity_attribute_container.EntityAttributeContainer(owner_id: str)#

Bases: medkit.core.attribute_container.AttributeContainer

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.

_norm_ids: list[str] = []#
property norms: list[medkit.core.text.entity_norm_attribute.EntityNormAttribute]#

Return the list of normalization attributes.

add(attr: medkit.core.attribute.Attribute)#

Attach an attribute to the annotation.

Parameters:
attrAttribute

Attribute to add.

Raises:
ValueError

If the attribute is already attached to the annotation (based on attr.uid).

get_norms() list[medkit.core.text.entity_norm_attribute.EntityNormAttribute]#

Return a list of the normalization attributes of the annotation.