Constructors

Methods

  • Checks if this list of nodes forms a continuous sequence. Assumes the nodes to be sorted and from the same sentence (not checked).

    Type Parameters

    Parameters

    • tokens: T[]

      A list of nodes

    Returns boolean

    true if the list is continuous, false otherwise.

  • Checks if all nodes come from the same sentence.

    Type Parameters

    Parameters

    • tokens: T[]

      A list of nodes.

    Returns boolean

    true if the list of nodes is empty or all nodes are within the same sentence; false otherwise.

  • Checks if this list of nodes is sorted by word-order (i.e. their sentence index).

    Type Parameters

    Parameters

    • tokens: T[]

      A list of nodes, assumed to be from the same sentenced (not checked).

    Returns boolean

  • Orders the list of nodes in-place by word-order (i.e. their sentence index).

    Type Parameters

    Parameters

    • tokens: T[]

      A list of nodes, assumed to be from the same sentence (not checked).

    Returns T[]

  • Orders a copy of this list of nodes by word-order (i.e. their sentence index).

    Type Parameters

    Parameters

    • tokens: T[]

      A list of nodes, assumed to be from the same sentenced (not checked).

    Returns T[]

  • Utility method converting this list of nodes to a string with a simplified node representation, using [Node.toSimpleString].

    Type Parameters

    Parameters

    • tokens: T[]

      A list of nodes.

    • quote: boolean = false

      Should each node string be surrounded with double quotes?

    Returns string