def add(self, offset, entity_type, entity_value):
"""
Adds a found entity to list. The `offset` parameter is used as key, so
only one entity can start at the given offset.
:param offset: Offset in extracted text where the found entity starts.
:param entity_type: The type of entity that is found.
:param entity_value: The found entity.
:type start: ``int``
:type entity_type: ``unicode``
:type entity_value: ``unicode``
"""
self.obj[offset] = {
'type': entity_type,
'value': entity_value,
'entity_id': re.sub(r'\s', '_', entity_value).lower()
}
评论列表
文章目录