Skip to content

Commit bf40b8a

Browse files
committed
Add testing for unigrams, bigrams, and isegment
1 parent afdc177 commit bf40b8a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/test_coverage.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import os
22
import sys
33
from .context import wordsegment
4-
from wordsegment import load, main, segment
4+
from wordsegment import load, main, isegment, segment, unigrams, bigrams
55

66
load()
77

8+
def test_unigrams():
9+
assert 'test' in unigrams
10+
11+
def test_bigrams():
12+
assert 'in the' in bigrams
13+
814
def test_segment_0():
915
result = ['choose', 'spain']
1016
assert segment(''.join(result)) == result
@@ -72,7 +78,7 @@ def test_segment_11():
7278
'it', 'to', 'sit', 'down', 'on', 'or', 'to', 'eat', 'it', 'was', 'a',
7379
'hobbit', 'hole', 'and', 'that', 'means', 'comfort'
7480
]
75-
assert segment(''.join(result)) == result
81+
assert list(isegment(''.join(result))) == result
7682

7783
def test_segment_12():
7884
result = [

0 commit comments

Comments
 (0)