示例#1
0
def test_segments_min_length_bottom():
    segment_set = ContiguousSegmentSet(
        min_segment_length=150,
        small_segment_vanish_strategy="bottom")
    segments = segment_set.fit_transform(_dataset)
    assert segments.shape == _dataset.shape
    assert len(segments[0]) == 2
    assert "\n\n".join(_segments[0:2]) in segments[0]
    assert "\n\n".join(_segments[2:4]) in segments[0]
    assert _segments[4] not in segments[0]
示例#2
0
def test_segments_min_length_top():
    segment_set = ContiguousSegmentSet(
        min_segment_length=150,
        small_segment_vanish_strategy="top")
    segments = segment_set.fit_transform(_dataset)
    assert segments.shape == _dataset.shape
    assert len(segments[0]) == 2
    assert _segments[0] not in segments[0]
    assert "\n\n".join(_segments[1:3]) in segments[0]
    assert "\n\n".join(_segments[3:5]) in segments[0]
示例#3
0
def test_segments_min_length_vanish():
    segment_set = ContiguousSegmentSet(
        min_segment_length=150)
    segments = segment_set.fit_transform(_dataset)
    assert segments.shape == _dataset.shape
    assert len(segments[0]) == 2
    assert _segments[0] not in segments[0]
    assert _segments[1] in segments[0]
    assert _segments[2] not in segments[0]
    assert _segments[3] in segments[0]
    assert _segments[4] not in segments[0]
示例#4
0
def test_segments_defailt_fit_transform():
    segment_set = ContiguousSegmentSet()
    segments = segment_set.fit_transform(_dataset)
    assert segments.shape == _dataset.shape
    assert len(segments[0]) == 5