소스 검색

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

tags/v0.2
Ben Kurtovic 9 년 전
부모
커밋
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):


불러오는 중...
취소
저장