mirror of
https://github.com/explosion/spaCy.git
synced 2025-09-19 10:32:40 +03:00
add failing test for too short a sentence
This commit is contained in:
parent
0f5c586e2f
commit
0d81bce9cc
|
@ -50,7 +50,17 @@ def test_initialized(nlp):
|
||||||
assert nlp.pipe_names == ["coref"]
|
assert nlp.pipe_names == ["coref"]
|
||||||
text = "She gave me her pen."
|
text = "She gave me her pen."
|
||||||
doc = nlp(text)
|
doc = nlp(text)
|
||||||
# The results of this are weird & non-deterministic
|
# TODO: The results of this are weird & non-deterministic
|
||||||
|
print(doc.spans)
|
||||||
|
|
||||||
|
|
||||||
|
def test_initialized_short(nlp):
|
||||||
|
nlp.add_pipe("coref")
|
||||||
|
nlp.initialize()
|
||||||
|
assert nlp.pipe_names == ["coref"]
|
||||||
|
text = "Hi there"
|
||||||
|
# TODO: this crashes with an IndexError: too many indices
|
||||||
|
doc = nlp(text)
|
||||||
print(doc.spans)
|
print(doc.spans)
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,8 +69,7 @@ def test_initialized_2(nlp):
|
||||||
nlp.initialize()
|
nlp.initialize()
|
||||||
assert nlp.pipe_names == ["coref"]
|
assert nlp.pipe_names == ["coref"]
|
||||||
text = "She gave me her pen."
|
text = "She gave me her pen."
|
||||||
doc = nlp(text)
|
# TODO: This crashes though it works when using intermediate var 'doc' !
|
||||||
# TODO: THIS CRASHES
|
|
||||||
print(nlp(text).spans)
|
print(nlp(text).spans)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user