mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 09:56:28 +03:00
Raise errors when no actions are available, re Issue #429
This commit is contained in:
parent
fc4a7ad794
commit
430473bd98
|
@ -109,9 +109,11 @@ cdef class Parser:
|
||||||
cdef int nr_class = self.moves.n_moves
|
cdef int nr_class = self.moves.n_moves
|
||||||
cdef int nr_feat = self.model.nr_feat
|
cdef int nr_feat = self.model.nr_feat
|
||||||
with nogil:
|
with nogil:
|
||||||
self.parseC(tokens.c, tokens.length, nr_feat, nr_class)
|
status = self.parseC(tokens.c, tokens.length, nr_feat, nr_class)
|
||||||
# Check for KeyboardInterrupt etc. Untested
|
# Check for KeyboardInterrupt etc. Untested
|
||||||
PyErr_CheckSignals()
|
PyErr_CheckSignals()
|
||||||
|
if status != 0:
|
||||||
|
raise ValueError("Error parsing doc: %s" % tokens.text)
|
||||||
self.moves.finalize_doc(tokens)
|
self.moves.finalize_doc(tokens)
|
||||||
|
|
||||||
def pipe(self, stream, int batch_size=1000, int n_threads=2):
|
def pipe(self, stream, int batch_size=1000, int n_threads=2):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user