mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
add jieba.posseg test case
This commit is contained in:
parent
b0f9e6721e
commit
0c050b5eb2
@ -129,6 +129,14 @@ class JiebaTestCase(unittest.TestCase):
|
|||||||
assert isinstance(result, list), "Test CutForSearch error on content: %s" % content
|
assert isinstance(result, list), "Test CutForSearch error on content: %s" % content
|
||||||
print >> sys.stderr, " , ".join(result)
|
print >> sys.stderr, " , ".join(result)
|
||||||
|
|
||||||
|
def testPosseg(self):
|
||||||
|
import jieba.posseg as pseg
|
||||||
|
for content in test_contents:
|
||||||
|
result = pseg.cut(content)
|
||||||
|
result = list(result)
|
||||||
|
assert isinstance(result, list), "Test Posseg error on content: %s" % content
|
||||||
|
print >> sys.stderr, " , ".join([w.word + " / " + w.flag for w in result])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user