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()
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)
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()