Tree

CoreNLP/util. Tree

Class representing a Parse tree structure

Constructor

new Tree(node)

Source:
See:

The nodes are given in order left to right as the words in a sentence appears The leaves are grouped into semantic representations provided by the Annotator This class is pretty useful to use along with the ParserAnnotator

Parameters:
Name Type Description
node Node

Methods

(static) fromSentence(sentence, doubleLinkopt) → {Tree}

Source:
Parameters:
Name Type Attributes Default Description
sentence Sentence
doubleLink boolean <optional>
false

whether the child nodes should have a reference to their parent or not - this allows the use of Node.parent()

Returns:

tree

Type
Tree

(static) fromString(str, doubleLinkopt) → {Tree}

Source:
Parameters:
Name Type Attributes Default Description
str string
doubleLink boolean <optional>
false

whether the child nodes should have a reference to their parent or not - this allows the use of Node.parent()

Returns:

tree

Type
Tree

dump() → {string}

Source:

Get a Tree string representation for debugging purposes

Returns:

tree

Type
string

visitDeepFirst()

Source:
See:

Performs Deep-first Search calling a visitor for each node

visitDeepFirstRight()

Source:
See:

Performs Deep-first Search calling a visitor for each node, from right to left

visitLeaves()

Source:
See:

Performs Deep-first Search calling a visitor only over leaves