Determine distrinct matches for one colocation id.

This commit is contained in:
Ozbolt Menegatti 2019-06-08 11:25:55 +02:00
parent 2773a8b9e9
commit 9ae7e1e9f6

View File

@ -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)