treeSize: Measures the number of symbols in a derivation tree.

View source: R/derivationTrees.R

treeSizeR Documentation

Measures the number of symbols in a derivation tree.

Description

treeSize() returns the number of symbols in a derivation tree.

Usage

treeSize(tree)

Arguments

tree

Derivation tree.

Value

Integer. Number of symbols in a derivation tree.

See Also

Other Measures of Tree Attributes: treeLeaves(), treeListDepth(), treeNodes(), treeProbability()

Examples

g<-compileBNF(booleanGrammar())
a<-randomDerivationTree(g$Start, g)
treeSize(a) 


xegaDerivationTrees documentation built on April 16, 2025, 5:11 p.m.