From 9ae7e1e9f6d1a6efc58add9cdfd95f7688de5e42 Mon Sep 17 00:00:00 2001 From: Ozbolt Menegatti Date: Sat, 8 Jun 2019 11:25:55 +0200 Subject: [PATCH] Determine distrinct matches for one colocation id. --- wani.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wani.py b/wani.py index a8ead9b..57f2840 100644 --- a/wani.py +++ b/wani.py @@ -1112,6 +1112,13 @@ class StructureMatch: self.matches = [] self.representations = {} + def distinct_matches(self): + dm = set() + keys = list(self.matches[0].keys()) + for words in self.matches: + dm.add(" ".join(words[k].text for k in keys)) + return len(dm) + def append(self, match): self.matches.append(match)