From 41a6adf1f688a6eec523091002f5cfe4910339fc Mon Sep 17 00:00:00 2001 From: ines Date: Fri, 2 Jun 2017 10:57:25 +0200 Subject: [PATCH] Initialise Vocab length correctly --- spacy/vocab.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spacy/vocab.pyx b/spacy/vocab.pyx index 57518f3aa..d3aa426cd 100644 --- a/spacy/vocab.pyx +++ b/spacy/vocab.pyx @@ -54,6 +54,7 @@ cdef class Vocab: self._by_hash = PreshMap() self._by_orth = PreshMap() self.strings = StringStore() + self.length = 0 if strings: for string in strings: _ = self[string] @@ -63,8 +64,6 @@ cdef class Vocab: self.lex_attr_getters = lex_attr_getters self.morphology = Morphology(self.strings, tag_map, lemmatizer) - self.length = 1 - property lang: def __get__(self): langfunc = None