new Tag(canonicalText)
Creates a new tag
Name | Type | Description |
---|---|---|
canonicalText | string | The canonical text Represents the result of a Tagger |
Methods
canonicalText() → {string}
Returns the canonical text of the tag
- Since
- 5.2.0
- Type:
- string
customProperties() → {object}
Returns optional custom properties of the tag
- Since
- 5.2.0
- Type:
- object
element() → {$k.SemanticElement}
The semantic element associated with this tag
- Since
- 5.2.0
- Type:
- $k.SemanticElement
interfaceTagType() → {string}
Returns the tag type returned by the tagging interface
- Since
- 5.2.0
- Type:
- string
language() → {string}
Returns the language of the tag
- Since
- 5.2.0
- Type:
- string
linkingRelation() → {$k.SemanticElement}
Returns the relation between the source object and the tagged object
- Since
- 5.2.0
- Type:
- $k.SemanticElement
quality() → {number}
Returns the quality of the tag as returned by the interface
- Since
- 5.2.0
- Type:
- number
setCanonicalText()
Sets the canonical text of the tag
- Since
- 5.2.0
setElement()
Set the semantic element associated with this tag
- Since
- 5.2.0
setInterfaceTagType()
Set the interface tag type. This type can be used in the tagging configuration.
- Since
- 5.2.0
setLanguage()
Sets the language of the tag
- Since
- 5.2.0
setLinkingRelation()
Sets the relation between the source object and the tagged object
- Since
- 5.2.0
setQuality()
Sets the quality of the tag
- Since
- 5.2.0
setTextVariants()
Sets other text variants of the tag
- Since
- 5.2.0
spans() → {$k.SemanticElement}
Returns the spans of the tag. A span is returned as { start: startIndex, end: endIndex }
- Since
- 5.2.0
- Type:
- $k.SemanticElement
tagTypePriority() → {number}
Returns the priority of the tag type, given by the order in the hierarchy
- Since
- 5.3.0
- Type:
- number
textVariants() → {Array.<string>}
Returns other text variants of the tag found in the text
- Since
- 5.2.0
- Type:
- Array.<string>