Procházet zdrojové kódy

Update highlighter for new MarkovChain implementation

master
Ben Kurtovic před 5 roky
rodič
revize
c73179b28c
1 změnil soubory, kde provedl 2 přidání a 3 odebrání
  1. +2
    -3
      copyvios/highlighter.py

+ 2
- 3
copyvios/highlighter.py Zobrazit soubor

@@ -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())


Načítá se…
Zrušit
Uložit