mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +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)
|
return Lexeme.get_struct_attr(token.lex, feat_name)
|
||||||
|
|
||||||
def _get_chunker(lang):
|
def _get_chunker(lang):
|
||||||
cls = util.get_lang_class(lang)
|
try:
|
||||||
return cls.Defaults.syntax_iterators.get('noun_chunks')
|
cls = util.get_lang_class(lang)
|
||||||
|
except ImportError:
|
||||||
|
return None
|
||||||
|
except KeyError:
|
||||||
|
return None
|
||||||
|
return cls.Defaults.syntax_iterators.get(u'noun_chunks')
|
||||||
|
|
||||||
cdef class Doc:
|
cdef class Doc:
|
||||||
"""A sequence of Token objects. Access sentences and named entities, export
|
"""A sequence of Token objects. Access sentences and named entities, export
|
||||||
|
|
Loading…
Reference in New Issue
Block a user