瀏覽代碼

Whoops, got the slicing wrong.

tags/v0.1^2
Ben Kurtovic 12 年之前
父節點
當前提交
17eee28a4b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      earwigbot/wiki/copyvios/markov.py

+ 1
- 1
earwigbot/wiki/copyvios/markov.py 查看文件

@@ -40,7 +40,7 @@ class MarkovChain(object):
words = ([self.START] * padding) + words + ([self.END] * padding)
for i in range(len(words) - self.degree + 1):
last = i + self.degree - 1
self.chain[words[i:last]][last] += 1
self.chain[words[i:last]][words[last]] += 1

def __repr__(self):
"""Return the canonical string representation of the MarkovChain."""


||||||
x
 
000:0
Loading…
取消
儲存