RosettaCodeData/Task/Execute-a-Markov-algorithm/Racket/execute-a-markov-algorithm-2.rkt

12 lines
283 B
Racket
Raw Permalink Normal View History

2013-06-05 21:47:54 +00:00
> (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."