Pārlūkot izejas kodu

Reorder length check to potentially fix an empty-query bug.

tags/v0.2
Ben Kurtovic pirms 10 gadiem
vecāks
revīzija
c4dede1459
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +2
    -2
      earwigbot/wiki/copyvios/parsers.py

+ 2
- 2
earwigbot/wiki/copyvios/parsers.py Parādīt failu

@@ -99,13 +99,13 @@ class ArticleTextParser(BaseTextParser):

sentences = []
for sentence in tokenizer.tokenize(self.clean):
if len(sentence) < min_query:
continue
if len(sentence) > max_query:
words = sentence.split()
while len(" ".join(words)) > max_query:
words.pop()
sentence = " ".join(words)
if len(sentence) < min_query:
continue
sentences.append(sentence)

if max_chunks >= len(sentences):


Notiek ielāde…
Atcelt
Saglabāt