- # otherwise compute
- full, _ = self._cache.names.get(norm_name, (None, None))
-
- if full is None:
- with self.conn.cursor() as cur:
- cur.execute("SELECT word_id FROM word WHERE word = %s and type = 'W' LIMIT 1",
- (norm_name, ))
- if cur.rowcount > 0:
- full = cur.fetchone()[0]
+ with self.conn.cursor() as cur:
+ cur.execute("SELECT word_id FROM word WHERE word_token = %s and type = 'W'",
+ (norm_name, ))
+ full = [row[0] for row in cur]