A tecto token, i.e. a tectogrammatical abstraction of a word (e.g. "did not sleep" are three tokens but a single tecto-token) Tecto tokens have an zero-based index reflecting their position within their sentence.

Hierarchy (View Summary)

Properties

children: TectoToken[] = []

Nodes that depend on this node, ordered by word-order; empty for leafs or if no tree-structure is in the analysis.

entity: null | Entity

Legacy value: Entity associated with this tecto token; null if there is no such entity. (Used only by F3, not by G3)

entityMention: null | EntityMention

Entity mention associated with this tecto token; null if there is no such entity.

feats: Map<string, string>

Grammatical and other features of the tecto token.

fnc: string

Label of the dependency edge.

id: string

ID of this node used to refer to it from other objects.

idx: number

Zero-based index of this node reflecting its word-order position within the sentence.

lemma: string

Tecto lemma.

parent: null | TectoToken = null

Node that this node depends on. Null for the root or if no tree-structure is in the analysis.

sentence: Sentence

Sentence this node belongs to. Can be null only during construction.

tokens: null | TokenSupport

Surface token corresponding to this tecto token; not necessarily adjacent; ordered by word-order; Might be null, because the root or dropped phrases have no surface realization.

Methods

  • All nodes dominated by this node.

    Parameters

    • reflexive: boolean = true

      Whether this node itself is included.

    • ordered: boolean = true

      Whether the result should be ordered by word order.

    Returns TectoToken[]

  • Depth of this node in the dependency tree.

    Returns number

    The distance, i.e. number of dependency edges, from the root of the sentence.

  • In-order iterator over the subtree of this node, optionally skipping some subtrees.

    Parameters

    • includeFilteredRoot: boolean = true

      If true, the nodes on which [skipPredicate] returns true are included in the result.

    • skipPredicate: (n: TectoToken) => boolean

      When this predicate is true on any node, the node's subtree is not traversed (skipping only their subtrees).

    Returns Iterable<TectoToken>

  • Pre-order iterator over the subtree of this node, optionally skipping some subtrees.

    Parameters

    • includeFilteredRoot: boolean = true

      If true, the nodes on which [skipPredicate] returns true are included in the result (skipping only their subtrees).

    • skipPredicate: (n: TectoToken) => boolean

      When this predicate is true on any node, the node's subtree is not traversed.

    Returns Iterable<TectoToken>

  • Check whether this node is a leaf (i.e has no dependents).

    Returns boolean

  • Indented string representation of the subtree of this node.

    Parameters

    • printToken: (token: TectoToken) => string

      A function printing individual nodes.

    • indentStr: string = " "

      A string used to indent each level from the previous one.

    • depth: number = 0

      Indentation level to start with.

    Returns string

  • Converts the token to a non-recursive string: index + [lemma] + [fnc].

    Parameters

    • lemma: boolean
    • fnc: boolean

    Returns string

  • Parenthesised representation of the subtree of this node.

    Parameters

    • printToken: (token: TectoToken) => string

      Function printing individual nodes.

    Returns string

    A string representation of the tree rooted in this node.

  • TectoToken factory method, public constructor.

    Parameters

    • id: string
    • idx: number
    • fnc: string
    • lemma: string
    • feats: null | Map<string, string> = null
    • tokens: null | Token[] = null
    • entityMention: null | EntityMention = null
    • entity: null | Entity = null

    Returns TectoToken