From 20ff1134f8e72980a52f37aca545f50e69179be0 Mon Sep 17 00:00:00 2001 From: William Dowling Date: Thu, 28 Apr 2022 22:10:46 +0000 Subject: [PATCH] Fix issues in https://github.com/nlplab/brat/issues/1393, tested with Python 3.10 --- server/src/simstringlib.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/src/simstringlib.py b/server/src/simstringlib.py index e69be2565..b37beb9ce 100644 --- a/server/src/simstringlib.py +++ b/server/src/simstringlib.py @@ -31,8 +31,7 @@ def __init__(self, dbfn, self.db = simstring.writer(self.dbfn) else: self.db = simstring.reader(self.dbfn) - - self.db.measure = SIMILARITY_MEASURES[similarity_measure] + self.db.measure = self.SIMILARITY_MEASURES[similarity_measure] self.db.threshold = threshold def build(self, strs): @@ -41,11 +40,11 @@ def build(self, strs): self.close() def insert(self, s): - assert self.build, "Error: build on non-build simstring" + assert self.is_build, "Error: build on non-build simstring" self.db.insert(s) def lookup(self, s): - assert not self.build, "Error: lookup on build simstring" + assert not self.is_build, "Error: lookup on build simstring" return self.db.retrieve(s) def close(self):