mirror of
https://github.com/explosion/spaCy.git
synced 2025-03-04 03:15:52 +03:00
* Restore support for orths_and_spaces argument in Doc.__init__
This commit is contained in:
parent
11bffaa1ab
commit
3186379253
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user