RosettaCodeData/Task/Execute-a-Markov-algorithm/Racket/execute-a-markov-algorithm-2.rkt
2023-07-01 13:44:08 -04:00

11 lines
283 B
Racket

> (define MA
(Markov-algorithm
(-> "A" "apple")
(-> "B" "bag")
(->. "S" "shop")
(-> "T" "the")
(-> "the shop" "my brother")
(->. "a never used" "terminating rule")))
> (MA "I bought a B of As from T S.")
"I bought a bag of apples from T shop."