mirror of https://github.com/explosion/spaCy.git
1bb87f35bc
* detect cycle during projectivize * not complete test to detect cycle in projectivize * boolean to int type to propagate error * use unordered_set instead of set * moved error message to errors * removed cycle from test case * use find instead of count * cycle check: only perform one lookup * Return bool again from _has_head_as_ancestor Communicate presence of cycles through an output argument. * Switch to returning std::pair to encode presence of a cycle The has_cycle pointer is too easy to misuse. Ideally, we would have a sum type like Rust's `Result` here, but C++ is not there yet. * _is_non_proj_arc: clarify what we are returning * _has_head_as_ancestor: remove count We are now explicitly checking for cycles, so the algorithm must always terminate. Either we encounter the head, we find a root, or a cycle. * _is_nonproj_arc: simplify condition * Another refactor using C++ exceptions * Remove unused error code * Print graph with cycle on exception * Include .hh files in source package * Add FIXME comment * cycle detection test * find cycle when starting from problematic vertex Co-authored-by: Daniël de Kok <me@danieldk.eu> |
||
---|---|---|
.. | ||
cli | ||
displacy | ||
lang | ||
matcher | ||
ml | ||
pipeline | ||
tests | ||
tokens | ||
training | ||
__init__.pxd | ||
__init__.py | ||
__main__.py | ||
about.py | ||
attrs.pxd | ||
attrs.pyx | ||
compat.py | ||
default_config.cfg | ||
default_config_pretraining.cfg | ||
errors.py | ||
glossary.py | ||
kb.pxd | ||
kb.pyx | ||
language.py | ||
lexeme.pxd | ||
lexeme.pyi | ||
lexeme.pyx | ||
lookups.py | ||
morphology.pxd | ||
morphology.pyx | ||
parts_of_speech.pxd | ||
parts_of_speech.pyx | ||
pipe_analysis.py | ||
py.typed | ||
schemas.py | ||
scorer.py | ||
strings.pxd | ||
strings.pyi | ||
strings.pyx | ||
structs.pxd | ||
symbols.pxd | ||
symbols.pyx | ||
tokenizer.pxd | ||
tokenizer.pyx | ||
ty.py | ||
typedefs.pxd | ||
typedefs.pyx | ||
util.py | ||
vectors.pyx | ||
vocab.pxd | ||
vocab.pyi | ||
vocab.pyx |