def test_entity_type():
    tok_per = Token(entity_type=EntityType.PER)
    tok_foo = Token(entity_type=EntityType.CUSTOM_TYPE,
                    custom_entity_type='foo')

    assert get_entity_type(tok_per) == 'PER'
    assert get_entity_type(tok_foo) == 'foo'
Exemple #2
0
def is_loc(token):
    netype = None
    if token.entity_type != 3 and token.entity_type != 4:
        netype = sc.get_entity_type(token)
    if netype == 'LOC':
        return True
    else:
        return False
Exemple #3
0
def is_loc(token):
    netype = None
    if token.entity_type != 3 and token.entity_type != 4:
        netype = sc.get_entity_type(token)
    if netype == 'LOC':
        return True
    else:
        return False
Exemple #4
0
def streamcorpus_is_loc(token):
    netype = None
    if token.entity_type != 3 and token.entity_type != 4:
        netype = sc.get_entity_type(token)
    if netype == "LOC":
        return True
    else:
        return False
def test_entity_type():
    tok_per = Token(entity_type=EntityType.PER)
    tok_foo = Token(entity_type=EntityType.CUSTOM_TYPE, custom_entity_type='foo')

    assert get_entity_type(tok_per) == 'PER'
    assert get_entity_type(tok_foo) == 'foo'