浏览代码

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

tags/v0.2
Ben Kurtovic 10 年前
父节点
当前提交
c4dede1459
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      earwigbot/wiki/copyvios/parsers.py

+ 2
- 2
earwigbot/wiki/copyvios/parsers.py 查看文件

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


正在加载...
取消
保存