View source: R/derivationTrees.R
chooseNode | R Documentation |
chooseNode()
returns a random attributed node
from an attributed node list.
chooseNode(ANL)
ANL |
Attributed node list. |
An attributed node
has the following elements:
ID
NonTerminal
Pos
Depth
Rdepth
subtreedepth
Index
These elements can be used e.g.
for inserting and extracting subtrees
(Pos
or node$Index
),
for checking
the feasibility of subtree substitution (ID
),
for checking depth bounds
(Depth
, RDepth
, and subtreedepth
),
...
An attributed node.
Other Random Choice:
chooseRule()
g<-compileBNF(booleanGrammar())
a<-randomDerivationTree(g$Start, g)
b<-treeANL(a, g$ST)
c<-chooseNode(b$ANL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.