Skip to content

Commit

Permalink
Merge branch 'Sygil-Dev:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroCool940711 authored Jan 3, 2024
2 parents f6ba17d + 16c6df4 commit fb85295
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_jieba.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@


def test_jieba_segmentation():
"""
Tests the segmentation of a Chinese text string using the jieba library.
This function does not take any parameters and does not return anything.
"""
text = "我爱自然语言处理"
seg_list = jieba.cut(text, cut_all=False)
assert list(seg_list) == ['我', '爱', '自然语言处理']

def test_jieba_import():
"""
Tests the import of the jieba library. This function does not take any parameters and does not return anything.
"""
assert jieba is not None

def test_jieba_tokenization():
"""
Tests the tokenization of a Chinese text string using the jieba library.
This function does not take any parameters and does not return anything.
"""
text = "我爱自然语言处理"
tokens = jieba.tokenize(text)
assert list(tokens) == [('我', 0, 1), ('爱', 1, 2), ('自然语言处理', 2, 8)]

0 comments on commit fb85295

Please sign in to comment.