mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
* Upd sbd tests
This commit is contained in:
parent
801bf14f4f
commit
27d9df49e7
|
@ -12,32 +12,29 @@ def test_single_period(EN):
|
||||||
string = 'A test sentence.'
|
string = 'A test sentence.'
|
||||||
words = EN(string)
|
words = EN(string)
|
||||||
assert len(words) == 4
|
assert len(words) == 4
|
||||||
assert list(words.sents) == [(0, 4)]
|
assert len(list(words.sents)) == 1
|
||||||
|
assert sum(len(sent) for sent in words.sents) == len(words)
|
||||||
|
|
||||||
|
|
||||||
def test_single_no_period(EN):
|
def test_single_no_period(EN):
|
||||||
string = 'A test sentence'
|
string = 'A test sentence'
|
||||||
words = EN(string)
|
words = EN(string)
|
||||||
assert len(words) == 3
|
assert len(words) == 3
|
||||||
assert list(words.sents) == [(0, 3)]
|
assert len(list(words.sents)) == 1
|
||||||
|
assert sum(len(sent) for sent in words.sents) == len(words)
|
||||||
|
|
||||||
|
|
||||||
def test_single_exclamation(EN):
|
def test_single_exclamation(EN):
|
||||||
string = 'A test sentence!'
|
string = 'A test sentence!'
|
||||||
words = EN(string)
|
words = EN(string)
|
||||||
assert len(words) == 4
|
assert len(words) == 4
|
||||||
assert list(words.sents) == [(0, 4)]
|
assert len(list(words.sents)) == 1
|
||||||
|
assert sum(len(sent) for sent in words.sents) == len(words)
|
||||||
|
|
||||||
|
|
||||||
def test_single_question(EN):
|
def test_single_question(EN):
|
||||||
string = 'A test sentence?'
|
string = 'A test sentence?'
|
||||||
words = EN(string, tag=False, parse=False)
|
words = EN(string, tag=False, parse=False)
|
||||||
assert len(words) == 4
|
assert len(words) == 4
|
||||||
assert list(words.sents) == [(0, 4)]
|
assert len(list(words.sents)) == 1
|
||||||
|
assert sum(len(sent) for sent in words.sents) == len(words)
|
||||||
|
|
||||||
def test_(EN):
|
|
||||||
string = 'A test sentence?'
|
|
||||||
words = EN(string, tag=False, parse=False)
|
|
||||||
assert len(words) == 4
|
|
||||||
assert list(words.sents) == [(0, 4)]
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user