From 07242f74c8245124e444d44ab1db443e5c77120c Mon Sep 17 00:00:00 2001 From: Ozbolt Menegatti Date: Fri, 6 Sep 2019 14:55:36 +0200 Subject: [PATCH] Also remember representations step. --- src/match_store.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/match_store.py b/src/match_store.py index a5fe6d6..bebfe7a 100644 --- a/src/match_store.py +++ b/src/match_store.py @@ -90,6 +90,11 @@ class MatchStore: yield StructureMatch.from_db(self.db, cid[0], structure) def set_representations(self, word_renderer, structures): + step_name = 'representation' + if self.db.is_step_done(step_name): + print("Representation step already done, skipping") + return + structures_dict = {s.id: s for s in structures} num_representations = int(self.db.execute("SELECT Count(*) FROM Colocations").fetchone()[0]) for cid, sid in progress(self.db.execute("SELECT colocation_id, structure_id FROM Colocations"), "representations", total=num_representations): @@ -101,6 +106,7 @@ class MatchStore: INSERT INTO Representations (colocation_id, component_id, text) VALUES (?,?,?)""", (match.match_id, component_id, text)) + self.db.step_is_done(step_name) def determine_colocation_dispersions(self): step_name = 'dispersions'