예제 #1
0
def test_token_entity_intersection():
    # included
    assert determine_intersection(CH_correct_segmentation[1],
                                  CH_correct_entity) == len(
                                      CH_correct_segmentation[1].text)

    # completely outside
    assert determine_intersection(CH_correct_segmentation[2],
                                  CH_correct_entity) == 0

    # border crossing
    assert determine_intersection(CH_correct_segmentation[1],
                                  CH_wrong_entity) == 1
예제 #2
0
def test_token_entity_intersection():
    # included
    intsec = determine_intersection(CH_correct_segmentation[1],
                                    CH_correct_entity)
    assert intsec == len(CH_correct_segmentation[1].text)

    # completely outside
    intsec = determine_intersection(CH_correct_segmentation[2],
                                    CH_correct_entity)
    assert intsec == 0

    # border crossing
    intsec = determine_intersection(CH_correct_segmentation[1],
                                    CH_wrong_entity)
    assert intsec == 1