Class TreeBuilder<T>

Type Parameters

Constructors

Methods

  • Record a dependency edge. The tokens connected by the edge might be added later.

    Parameters

    • childIdx: number

      Index of the child token (note: tokens are indexed within their sentence).

    • parentIdx: number

      Index of the parent token (note: tokens are indexed within their sentence);

    Returns TreeBuilder<T>

    The builder to allow chained calls.

  • Record a single token as a node of the tree.

    Parameters

    • node: T

      Token to add. Its index must be correct, parent and children fields are ignored.

    Returns TreeBuilder<T>

    The builder to allow chained calls.

  • Record a collection of tokens as nodes of the tree.

    Parameters

    • nodes: Iterable<T>

      Tokens to add. Their index must be correct, parent and children fields are ignored.

    Returns TreeBuilder<T>

    The builder to allow chained calls.