[core] Correctly build the session execute call
authorVincent Michel <vincent.michel@logilab.fr>
Tue, 11 Jun 2013 09:38:02 +0200
changeset 333 47a62334bfaa
parent 332 5f12e8b7c094
child 334 3a319fcad5cb
[core] Correctly build the session execute call
core.py
--- a/core.py	Thu Jun 27 18:26:28 2013 +0200
+++ b/core.py	Tue Jun 11 09:38:02 2013 +0200
@@ -87,7 +87,7 @@
     def query_word(self, word):
         """ Query a word for a Named Entities Recognition process
         """
-        return [r[0] for r in self.session.execute(self.query, word=word)]
+        return [r[0] for r in self.session.execute(self.query, dict(word=word))]
 
 
 class NerdySourceAppidRql(AbstractNerdySource):
@@ -345,6 +345,7 @@
                 continue # this token overlaps with a previous match
             word = token.word
             # Applies preprocessors
+            # XXX Preprocessors may be sources dependant
             for preprocessor in self.preprocessors:
                 token = preprocessor(token)
                 if not token:
@@ -361,6 +362,7 @@
                         break
                 if recognized and self.unique:
                     break
+        # XXX Postprocess/filters may be sources dependant
         return self.postprocess(named_entities)
 
     def postprocess(self, named_entities):