From 903030fc0a0d545e652337d543c6167e2bb192b1 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 28 Nov 2014 19:59:50 +0100 Subject: Test the equality of the contents and of the titles. --- pyaggr3g470r/duplicate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pyaggr3g470r') diff --git a/pyaggr3g470r/duplicate.py b/pyaggr3g470r/duplicate.py index 23f4adc0..d63cb2e7 100644 --- a/pyaggr3g470r/duplicate.py +++ b/pyaggr3g470r/duplicate.py @@ -11,6 +11,8 @@ def compare_documents(feed): """ duplicates = [] for pair in itertools.combinations(feed.articles, 2): - if pair[0].content != "" and pair[0].content == pair[1].content: + if pair[0].content != "" and \ + (utils.clear_string(pair[0].title) == utils.clear_string(pair[1].title) or \ + utils.clear_string(pair[0].content) == utils.clear_string(pair[1].content)): duplicates.append(pair) return duplicates \ No newline at end of file -- cgit