瀏覽代碼

Collapse extra newlines to avoid distorting trigrams.

tags/v0.1^2
Ben Kurtovic 12 年之前
父節點
當前提交
33aa1d6744
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      earwigbot/wiki/copyvios/parsers.py

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

@@ -70,7 +70,8 @@ class ArticleTextParser(BaseTextParser):
The actual stripping is handled by :py:mod:`mwparserfromhell`.
"""
wikicode = mwparserfromhell.parse(self.text)
self.clean = wikicode.strip_code(normalize=True)
clean = wikicode.strip_code(normalize=True, collapse=True)
self.clean = clean.replace("\n\n", "\n") # Collapse extra newlines.
return self.clean

def chunk(self, nltk_dir, max_chunks, max_query=256):


Loading…
取消
儲存