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'