Make mark2 not executable
[rbot-mark] / test.rb
1 #! /usr/bin/ruby -w
2 # vim: set sw=2 et:
3 # Author: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
4 # New markov chain plugin tester
5
6 require 'mark2'
7
8 mkv = MarkovChainer.new
9
10 text = "This is a test, a nice little test indeed."
11
12 mkv.learn(text)
13
14 words = text.scan(MarkovChainer::WNW)
15
16 word = words.pick_one
17
18 puts "Word: %s, next: %s" % [word, mkv.next(word)]
19