diff options
Diffstat (limited to 'markov-serialise.rb')
-rwxr-xr-x | markov-serialise.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/markov-serialise.rb b/markov-serialise.rb index 00e459e..1199453 100755 --- a/markov-serialise.rb +++ b/markov-serialise.rb @@ -2,7 +2,7 @@ CHUNK = ARGV[1].to_i -stats = Hash.new +stats = {"__SETTINGS__" => {"__CHUNK__" => CHUNK}} words = File.readlines(ARGV[0]) .map(&:split) @@ -10,7 +10,7 @@ words = File.readlines(ARGV[0]) (0 .. (words.length - CHUNK - CHUNK)).each do |i| k = words[i...(i+CHUNK)] - v = words[(i+CHUNK)...(i+CHUNK+CHUNK)] + v = words[(i+CHUNK)] if stats.include?(k) then t = stats[k] if t.include?(v) then |