Пример #1
0
def tags_test():
    '''Test tags method'''
    parse = Parser()
    input = "n:prop|Anielle^n:prop|Anielle-POSS^ n|shoe-PL ?"
    expected = ['n:prop', 'POSS', 'n', '?']
    assert parse.tags(input) == expected

    input = "pro:wh|who~v|be&3S^pro:wh|who~v|have&3S^ n|pen v|be&3S pro:dem|that ?"
    expected = ["pro:wh", "v", "n", "v", "pro:dem", "?"]
    assert parse.tags(input) == expected

    input = "pro|you~v|be&PRES un#part|snap-PERF ."
    expected = ["pro", "v", "part", "."]
    assert parse.tags(input) == expected
Пример #2
0
def lemmas_test():
    '''Test lemmas method'''
    parse = Parser()
    input = "n:prop|Anielle^n:prop|Anielle-POSS^ n|shoe-PL ?"
    expected = ["Anielle", "'s", "shoe", "?"]
    assert parse.lemmas(input) == expected

    input = "pro:wh|who~v|be&3S^pro:wh|who~v|have&3S^ n|pen v|be&3S pro:dem|that ?"
    expected = ["who", "be", "pen", "be", "that", "?"]
    assert parse.lemmas(input) == expected

    input = "pro|you~v|be&PRES un#part|snap-PERF ."
    expected = ["you", "be", "unsnap", "."]
    assert parse.lemmas(input) == expected

    input = "co|no pro:dem|that~v|be&3S n:prop|Mama^n:prop|Mama-POSS^ ."
    expected = ["no", "that", "be", "Mama", "'s", "."]
    assert parse.lemmas(input) == expected