antimatter.cap_prep.applicator
#
Module Contents#
Classes#
SpanTagApplicator wraps user-provided span tags into intermediary form span |
Attributes#
- antimatter.cap_prep.applicator.TAG_SOURCE = 'manual'#
- antimatter.cap_prep.applicator.TAG_VERSION = (0, 0, 0)#
- class antimatter.cap_prep.applicator.SpanTagApplicator(span_tags: List[antimatter.tags.SpanTag])#
SpanTagApplicator wraps user-provided span tags into intermediary form span tags when the tag applies to cell data.
- span_tags_for_cell(cell_path: str, cell_val: bytes, field_type: antimatter.fieldtype.fieldtypes.FieldType) List[antimatter_engine.PySpanTag] #
Given the path to a cell, provide a list of intermediary form span tags that apply to the cell. The cell’s value and field type are used to ensure span tags are applied properly across various types of data. For example, when a user specifies start and end indices for a string, they likely intend to index it based on rune, not on byte.
- Parameters:
cell_path – The name of the path to a cell
cell_val – The value in generic form of the cell pointed to in the cell path
field_type – The original type of data in the cell
- Returns:
A list of span tags that apply to the cell pointed to in the cell path