|
|
|
@ -9,7 +9,6 @@ class MatchStore:
|
|
|
|
|
def __init__(self, args, db):
|
|
|
|
|
self.db = db
|
|
|
|
|
self.dispersions = {}
|
|
|
|
|
self.match_num = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.db.init("""CREATE TABLE Colocations (
|
|
|
|
@ -51,6 +50,8 @@ class MatchStore:
|
|
|
|
|
self.db.init("CREATE INDEX col_r ON Representations (colocation_id)")
|
|
|
|
|
self.db.init("CREATE INDEX disp_key ON Dispersions (structure_id, component_id, lemma)")
|
|
|
|
|
|
|
|
|
|
match_num = self.db.execute("SELECT MAX(match_id) FROM Matches").fetchone()[0]
|
|
|
|
|
self.match_num = 0 if match_num is None else match_num + 1
|
|
|
|
|
def _add_match(self, key, structure, match):
|
|
|
|
|
structure_id, key_str = key[0], str(key[1:])
|
|
|
|
|
cid = self.db.execute("SELECT colocation_id FROM Colocations WHERE key=? AND structure_id=?",
|
|
|
|
|