mirror of https://github.com/explosion/spaCy.git
* Fix issue #19: Allow parsing/pos tagging of empty strings
This commit is contained in:
parent
363473aeed
commit
312b3a45f3
|
@ -265,6 +265,8 @@ cdef class EnPosTagger:
|
|||
Args:
|
||||
tokens (Tokens): The tokens to be tagged.
|
||||
"""
|
||||
if tokens.length == 0:
|
||||
return 0
|
||||
cdef int i
|
||||
cdef atom_t[N_CONTEXT_FIELDS] context
|
||||
cdef const weight_t* scores
|
||||
|
|
|
@ -72,6 +72,9 @@ cdef class GreedyParser:
|
|||
Transition guess
|
||||
uint64_t state_key
|
||||
|
||||
if tokens.length == 0:
|
||||
return 0
|
||||
|
||||
cdef atom_t[CONTEXT_SIZE] context
|
||||
cdef int n_feats
|
||||
cdef Pool mem = Pool()
|
||||
|
|
Loading…
Reference in New Issue