mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-03 12:43:15 +03:00
* 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:
|
Args:
|
||||||
tokens (Tokens): The tokens to be tagged.
|
tokens (Tokens): The tokens to be tagged.
|
||||||
"""
|
"""
|
||||||
|
if tokens.length == 0:
|
||||||
|
return 0
|
||||||
cdef int i
|
cdef int i
|
||||||
cdef atom_t[N_CONTEXT_FIELDS] context
|
cdef atom_t[N_CONTEXT_FIELDS] context
|
||||||
cdef const weight_t* scores
|
cdef const weight_t* scores
|
||||||
|
|
|
@ -72,6 +72,9 @@ cdef class GreedyParser:
|
||||||
Transition guess
|
Transition guess
|
||||||
uint64_t state_key
|
uint64_t state_key
|
||||||
|
|
||||||
|
if tokens.length == 0:
|
||||||
|
return 0
|
||||||
|
|
||||||
cdef atom_t[CONTEXT_SIZE] context
|
cdef atom_t[CONTEXT_SIZE] context
|
||||||
cdef int n_feats
|
cdef int n_feats
|
||||||
cdef Pool mem = Pool()
|
cdef Pool mem = Pool()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user