Determine distrinct matches for one colocation id.
This commit is contained in:
parent
2773a8b9e9
commit
9ae7e1e9f6
7
wani.py
7
wani.py
|
@ -1112,6 +1112,13 @@ class StructureMatch:
|
||||||
self.matches = []
|
self.matches = []
|
||||||
self.representations = {}
|
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):
|
def append(self, match):
|
||||||
self.matches.append(match)
|
self.matches.append(match)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user