chooseRule {xegaDerivationTrees}R Documentation

Selects a production rule index at random from a vector of production rules.

Description

chooseRule() selects a production rule index from the vector of production rule indices in the g$PT$LHS$ for a non-terminal symbol.

Usage

chooseRule(riv)

Arguments

riv

Vector of production rules indices for a non-terminal symbol.

Value

Integer. Index of the production rule.

See Also

Other Random Choice: chooseNode()

Examples

chooseRule(c(7, 8, 9))
chooseRule(as.vector(1))

[Package xegaDerivationTrees version 1.0.0.0 Index]