mirror of https://github.com/explosion/spaCy.git
* Fix tests
This commit is contained in:
parent
531182f937
commit
00ae3edd3a
|
@ -40,7 +40,7 @@ def test_entity_spans(nlp):
|
||||||
# nlp = English()
|
# nlp = English()
|
||||||
tokens = nlp('Mr. Best flew to New York on Saturday morning.')
|
tokens = nlp('Mr. Best flew to New York on Saturday morning.')
|
||||||
ents = list(tokens.ents)
|
ents = list(tokens.ents)
|
||||||
assert ents[0].label == 28061
|
assert ents[0].label == 346
|
||||||
assert ents[0].label_ == 'PERSON'
|
assert ents[0].label_ == 'PERSON'
|
||||||
assert ents[0].orth_ == 'Best'
|
assert ents[0].orth_ == 'Best'
|
||||||
assert ents[0].string == ents[0].string
|
assert ents[0].string == ents[0].string
|
||||||
|
@ -66,7 +66,7 @@ def test_count_by(nlp):
|
||||||
import numpy
|
import numpy
|
||||||
from spacy import attrs
|
from spacy import attrs
|
||||||
tokens = nlp('apple apple orange banana')
|
tokens = nlp('apple apple orange banana')
|
||||||
assert tokens.count_by(attrs.ORTH) == {2529: 2, 4117: 1, 6650: 1}
|
assert tokens.count_by(attrs.ORTH) == {3699: 2, 3750: 1, 5965: 1}
|
||||||
assert repr(tokens.to_array([attrs.ORTH])) == repr(numpy.array([[2529],
|
assert repr(tokens.to_array([attrs.ORTH])) == repr(numpy.array([[2529],
|
||||||
[2529],
|
[2529],
|
||||||
[4117],
|
[4117],
|
||||||
|
|
|
@ -29,7 +29,7 @@ def test_use_integer_ids_for_any_strings(nlp, token):
|
||||||
hello_id = nlp.vocab.strings['Hello']
|
hello_id = nlp.vocab.strings['Hello']
|
||||||
hello_str = nlp.vocab.strings[hello_id]
|
hello_str = nlp.vocab.strings[hello_id]
|
||||||
|
|
||||||
assert token.orth == hello_id == 3404
|
assert token.orth == hello_id == 3125
|
||||||
assert token.orth_ == hello_str == 'Hello'
|
assert token.orth_ == hello_str == 'Hello'
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue