aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/duplicate.py
blob: 23f4adc0e68e3e11be1e008581da838e6d0b6c07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /usr/bin/env python
#-*- coding: utf-8 -*-

import itertools
import utils


def compare_documents(feed):
    """
    Compare a list of documents by pair.
    """
    duplicates = []
    for pair in itertools.combinations(feed.articles, 2):
        if pair[0].content != "" and pair[0].content == pair[1].content:
            duplicates.append(pair)
    return duplicates
bgstack15