[normalize] Dont simplify item if they aren't basestrings
authorSimon Chabot <simon.chabot@logilab.fr>
Fri, 07 Dec 2012 13:52:20 +0100
changeset 182 59d328a2a35f
parent 174 90c4c74d5d8a
child 363 73f8afbe485d
[normalize] Dont simplify item if they aren't basestrings
normalize.py
--- a/normalize.py	Thu Nov 29 17:15:32 2012 +0100
+++ b/normalize.py	Fri Dec 07 13:52:20 2012 +0100
@@ -101,6 +101,9 @@
         2) Set the sentence to lower case
         3) Remove punctuation
     """
+    if not isinstance(sentence, basestring):
+        return sentence
+
     if lemmas:
         sentence = lemmatized(sentence, lemmas)
     sentence = sentence.lower()