+ def _retrieve_full_token(self, name):
+ """ Get the full name token for the given name, if it exists.
+ The name is only retrived for the standard analyser.
+ """
+ norm_name = self._normalized(name)
+
+ # return cached if possible
+ if norm_name in self._cache.fulls:
+ return self._cache.fulls[norm_name]
+
+ # 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]
+
+ self._cache.fulls[norm_name] = full
+
+ return full
+
+