MCPcopy Create free account
hub / github.com/hankcs/HanLP / test_enumerate_tokenization

Method test_enumerate_tokenization

tests/test_string_util.py:10–15  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8
9class TestStringUtility(unittest.TestCase):
10 def test_enumerate_tokenization(self):
11 text = '商品和服务'
12 toks = possible_tokenization(text)
13 assert len(set(toks)) == 2 ** (len(text) - 1)
14 for each in toks:
15 assert ''.join(each) == text
16
17
18if __name__ == '__main__':

Callers

nothing calls this directly

Calls 1

possible_tokenizationFunction · 0.90

Tested by

no test coverage detected