MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ replace() [2/3]

bool MayaFlux::Nodes::Network::RewriteOperator::replace ( SymbolId predecessor,
std::string_view successor,
double weight = 0.0 )

Append a rule whose successor is text.

A positive weight makes it one choice of a stochastic rule.

Definition at line 102 of file RewriteOperator.cpp.

103{
104 return replace(Replacement {
105 .predecessor = predecessor,
106 .weight = weight,
107 .successor = text_successor(successor) });
108}
static Successor text_successor(std::string_view text)
A successor that emits the text's characters as parameterless symbols.
bool replace(Replacement replacement)
Append a rule; false when the operator is invalid or the successor is empty.
One rewrite rule: left < predecessor > right, if predicate, with weight.

References replace(), and text_successor().

Here is the call graph for this function: