Skip to content

Commit

Permalink
Fix issues in nlplab#1393, tested with Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
william-dowling committed Apr 28, 2022
1 parent 44ecd82 commit 20ff113
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/src/simstringlib.py
Expand Up @@ -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):
Expand All @@ -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):
Expand Down

0 comments on commit 20ff113

Please sign in to comment.