* Fix issue #19: Allow parsing/pos tagging of empty strings

This commit is contained in:
Matthew Honnibal 2015-02-10 10:15:58 -05:00
parent 363473aeed
commit 312b3a45f3
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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()