Esempio n. 1
0
def test_how_are_you():
    test_util.start('Testing errors1.how_are_you...')
    assert not how_are_you(NLP('I am fine, thank you')).has_error
    assert how_are_you(NLP('I am fine thank you')).has_error
    assert how_are_you(NLP('I am fine thanks')).has_error
    test_util.result()
Esempio n. 2
0
def test_match_name():
    matches = [(NLP("My name's Tim."), 'Tim'), (NLP('My name is Bob'), 'Bob'),
               (NLP("It's Henry."), 'Henry'), (NLP('It is Frank'), 'Frank'),
               (NLP("I'm Hank"), 'Hank'), (NLP('I am Joe.'), 'Joe'),
               (NLP('Satan.'), 'Satan')]
    non_matches = [
        NLP('What is your name?'),  # far out
        NLP('My name is tim.'),  # missing capital
        NLP('Hi'),
        NLP('hi'),
        NLP('My nome it Tim')
    ]  # spelling mistakes
    test_util.test_matches(matches, non_matches, match_name)
Esempio n. 3
0
def test_nice_to_meet_you():
    test_util.start('Testing errors1.nice_to_meet_you...')
    assert not nice_to_meet_you(NLP('Nice to meet you, too')).has_error
    assert nice_to_meet_you(NLP('Nice to meet you')).has_error
    assert nice_to_meet_you(NLP('Nice to meet you too')).has_error
    test_util.result()