mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Fix fetching of noun chunk iterator
This commit is contained in:
parent
3680c51b8f
commit
2a3bd5ee90
|
@ -65,8 +65,13 @@ cdef attr_t get_token_attr(const TokenC* token, attr_id_t feat_name) nogil:
|
|||
return Lexeme.get_struct_attr(token.lex, feat_name)
|
||||
|
||||
def _get_chunker(lang):
|
||||
try:
|
||||
cls = util.get_lang_class(lang)
|
||||
return cls.Defaults.syntax_iterators.get('noun_chunks')
|
||||
except ImportError:
|
||||
return None
|
||||
except KeyError:
|
||||
return None
|
||||
return cls.Defaults.syntax_iterators.get(u'noun_chunks')
|
||||
|
||||
cdef class Doc:
|
||||
"""A sequence of Token objects. Access sentences and named entities, export
|
||||
|
|
Loading…
Reference in New Issue
Block a user