Execute a Markov algorithm: Difference between revisions
Content added Content deleted
(fix bug) |
(Expanded example) |
||
Line 3,602: | Line 3,602: | ||
I bought a bag of apples from my brother. |
I bought a bag of apples from my brother. |
||
</pre> |
</pre> |
||
<lang zkl>parseRuleSet( |
<lang zkl>parseRuleSet( // rule set in a list |
||
T("# Slightly modified from the rules on Wikipedia", |
|||
"A -> apple", "B -> bag", "S -> .shop", "T -> the", |
"A -> apple", "B -> bag", "S -> .shop", "T -> the", |
||
"the shop -> my brother", "a never used -> .terminating rule") : |
"the shop -> my brother", "a never used -> .terminating rule")) : |
||
markov("I bought a B of As from T S.",_).println(); |
markov("I bought a B of As from T S.",_).println(); |
||