Jump to content

Terminal and nonterminal functions: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
rm uncited original research that also happens to turn out to be nonsense
AnomieBOT (talk | contribs)
m Dating maintenance tags: {{Merge}}
Line 1: Line 1:
{{merge|terminal and nonterminal symbols}}
{{merge|terminal and nonterminal symbols|date=March 2018}}


In [[computer science]], a '''nonterminal function''' is a function (node) in a [[parse tree]] which is either a root or a branch in that tree whereas a '''terminal function''' is a function (node) in a parse tree which is a leaf.
In [[computer science]], a '''nonterminal function''' is a function (node) in a [[parse tree]] which is either a root or a branch in that tree whereas a '''terminal function''' is a function (node) in a parse tree which is a leaf.

Revision as of 05:40, 21 March 2018

In computer science, a nonterminal function is a function (node) in a parse tree which is either a root or a branch in that tree whereas a terminal function is a function (node) in a parse tree which is a leaf.

Background

A simple parse tree.

A parse tree is made up of nodes and branches.[1] In the picture below the parse tree is the entire structure, starting from S and ending in each of the leaf nodes (John,ball,the,hit).

In a parse tree, each node is either a root node, a branch node, or a leaf node. In the above example, S is a root node, NP and VP are branch nodes, while John, ball, the, and hit are all leaf nodes.

Nodes can also be referred to as parent nodes and child nodes. A parent node is one which has at least one other node linked by a branch under it. In the example, S is a parent of both NP and VP. A child node is one which has at least one node directly above it to which it is linked by a branch of the tree. Again from our example, hit is a child node of V.

See also

References