$k. Tag

new Tag(canonicalText)

Creates a new tag

Parameters:
NameTypeDescription
canonicalTextstring

The canonical text

Represents the result of a Tagger

Methods

canonicalText() → {string}

Returns the canonical text of the tag

Since
  • 5.2.0
Returns:
Type: 
string

customProperties() → {object}

Returns optional custom properties of the tag

Since
  • 5.2.0
Returns:
Type: 
object

element() → {$k.SemanticElement}

The semantic element associated with this tag

Since
  • 5.2.0
Returns:
Type: 
$k.SemanticElement

interfaceTagType() → {string}

Returns the tag type returned by the tagging interface

Since
  • 5.2.0
Returns:
Type: 
string

language() → {string}

Returns the language of the tag

Since
  • 5.2.0
Returns:
Type: 
string

linkingRelation() → {$k.SemanticElement}

Returns the relation between the source object and the tagged object

Since
  • 5.2.0
Returns:
Type: 
$k.SemanticElement

quality() → {number}

Returns the quality of the tag as returned by the interface

Since
  • 5.2.0
Returns:
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
Returns:
Type: 
$k.SemanticElement

tagTypePriority() → {number}

Returns the priority of the tag type, given by the order in the hierarchy

Since
  • 5.3.0
Returns:
Type: 
number

textVariants() → {Array.<string>}

Returns other text variants of the tag found in the text

Since
  • 5.2.0
Returns:
Type: 
Array.<string>