コード例 #1
0
 def test_2(self):
     data = " " * 16000
     segments = _segment(data, CompletionTriggerSegmentingStrategy(64))
     total = 0
     for segment in segments:
         total += len(segment) - 2
     assert total == len(data)
コード例 #2
0
 def test_4(self):
     data = " " * 46
     segments = _segment(
         data,
         CompletionTriggerSegmentingStrategy(80, maximum_segment_size=1024))
     total = 0
     for segment in segments:
         total += len(segment) - 2
     assert total == len(data)
コード例 #3
0
 def test_1(self):
     data = " " * 1000
     segments = _segment(data, ConstantSegmentSize())
     assert len(segments) == 1
     assert len(segments[0]) == 1002
コード例 #4
0
 def test_2(self):
     data = " " * 16000
     segments = _segment(data, ConstantSegmentSize())
     assert len(segments) == 2
     assert len(segments[0]) == 8191
     assert len(segments[1]) == 7813