* Compare to is not None, for more robustness

This commit is contained in:
Matthew Honnibal 2015-03-26 03:17:24 +01:00
parent 8f68b864c4
commit f02c39dfaf

View File

@ -243,7 +243,7 @@ cdef class Tokenizer:
lemma = props.get("L", None) lemma = props.get("L", None)
slice_unicode(&string, form, 0, len(form)) slice_unicode(&string, form, 0, len(form))
tokens[i].lex = <LexemeC*>self.vocab.get(self.vocab.mem, &string) tokens[i].lex = <LexemeC*>self.vocab.get(self.vocab.mem, &string)
if lemma: if lemma is not None:
tokens[i].lemma = self.vocab.strings[lemma] tokens[i].lemma = self.vocab.strings[lemma]
else: else:
tokens[i].lemma = 0 tokens[i].lemma = 0