* Restore support for orths_and_spaces argument in Doc.__init__

This commit is contained in:
Matthew Honnibal 2016-04-28 14:32:06 +02:00
parent 11bffaa1ab
commit 3186379253

View File

@ -82,6 +82,13 @@ cdef class Doc:
self._py_tokens = []
self._vector = None
self.noun_chunks_iterator = DocIterator(self)
cdef unicode orth
cdef bint has_space
cdef const LexemeC* lex
if orths_and_spaces:
for orth, has_space in orths_and_spaces:
lex = self.vocab.get(self.mem, orth)
self.push_back(lex, has_space)
def __getitem__(self, object i):
"""Get a Token or a Span from the Doc.