浏览代码

Update highlighter for new MarkovChain implementation

copyvios-ng
Ben Kurtovic 5 年前
父节点
当前提交
c73179b28c
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. +2
    -3
      copyvios/highlighter.py

+ 2
- 3
copyvios/highlighter.py 查看文件

@@ -16,14 +16,13 @@ def highlight_delta(context, chain, delta):
delta = EMPTY_INTERSECTION
for word in chain.text.split() + ([chain.END] * degree):
word = _strip_word(chain, word)
tblock = tuple(block)
if tblock in delta.chain and word in delta.chain[tblock]:
block.append(word)
if tuple(block) in delta.chain:
highlights[-1 * degree:] = [True] * degree
highlights.append(True)
else:
highlights.append(False)
block.popleft()
block.append(word)

i = degree
numwords = len(chain.text.split())


正在加载...
取消
保存