def test_match_pattern(self): self.assertEqual( {'y': ['bob'], 'x': ['john', 'jay']}, eliza.match_pattern( 'hello ?y my name is ?*x pleased to meet you'.split(), 'hello bob my name is john jay pleased to meet you'.split(), {}))
def test_match_pattern(self): self.assertEqual( { 'y': ['bob'], 'x': ['john', 'jay'] }, eliza.match_pattern( 'hello ?y my name is ?*x pleased to meet you'.split(), 'hello bob my name is john jay pleased to meet you'.split(), {}))
def test_match_var(self): self.assertEqual({'x': ['bob']}, eliza.match_pattern('?x', 'bob', {}))
def test_match_segment(self): self.assertEqual({'x': ['hello', 'bob']}, eliza.match_pattern(['?*x', 'world'], ['hello', 'bob', 'world'], {}))
def test_match_no_more_vars_fail(self): self.assertFalse(eliza.match_pattern(['hello', 'world'], ['hello', 'bob'], {}))
def test_no_more_vars(self): self.assertEqual({}, eliza.match_pattern(['hello', 'world'], ['hello', 'world'], {}))
def test_empty_pattern(self): self.assertFalse(eliza.match_pattern([], ['foo', 'bar'], {}))
def test_empty_input(self): self.assertFalse(eliza.match_pattern(['foo', '?x'], [], {}))
def test_match_no_more_vars_fail(self): self.assertFalse( eliza.match_pattern(['hello', 'world'], ['hello', 'bob'], {}))