filterANL {xegaDerivationTrees}R Documentation

Filter an Attributed Node List (ANL) of a derivation tree by depth.

Description

filterANL() deletes all nodes whose depth node$Depth is less than minb and larger than maxb from the ANL. However, if the resulting list is empty, the original ANL is returned.

Usage

filterANL(ANL, minb = 1, maxb = 3)

Arguments

ANL

Attributed node list.

minb

Integer.

maxb

Integer.

Details

An attributed node has the following elements:

Value

An attributed node list with nodes whose depths are in minb:maxb. Each node is represented as a list of the following attributes:

See Also

Other Access Tree Parts: filterANLid(), treeANL(), treeChildren(), treeRoot()

Examples

g<-compileBNF(booleanGrammar())
set.seed(111)
a<-randomDerivationTree(g$Start, g, maxdepth=10)
b<-treeANL(a, g$ST)
c<-filterANL(b, minb=1, maxb=3)
d<-filterANL(b, minb=3, maxb=5)
e<-filterANL(b, minb=14, maxb=15)
f<-filterANL(b, minb=13, maxb=15)


[Package xegaDerivationTrees version 1.0.0.0 Index]