From c73179b28cef75f3574407b08f6f5d1058e007a2 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 24 Feb 2019 00:06:30 -0500 Subject: [PATCH] Update highlighter for new MarkovChain implementation --- copyvios/highlighter.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/copyvios/highlighter.py b/copyvios/highlighter.py index ae806de..a3fb21f 100644 --- a/copyvios/highlighter.py +++ b/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())