HUGE refactor, creating lots of modules, no code changes though!
This commit is contained in:
20
src/match.py
Normal file
20
src/match.py
Normal file
@@ -0,0 +1,20 @@
|
||||
class StructureMatch:
|
||||
def __init__(self, match_id, structure):
|
||||
self.match_id = match_id
|
||||
self.structure = structure
|
||||
|
||||
self.matches = []
|
||||
self.representations = {}
|
||||
|
||||
def distinct_forms(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)
|
||||
|
||||
def __len__(self):
|
||||
return len(self.matches)
|
||||
Reference in New Issue
Block a user