예제 #1
0
def test_query():
    kb = KnowledgeBase(
        [
            ("i", "like", "cookies"),
            ("i", "like", "milk"),
            ("i", "type", "person"),
            ("i", "type", "living_thing"),
            ("cookies", "quality", "good"),
        ]
    )
    assert kb.query("i", "like", "quality") == {"good"}
예제 #2
0
def test_query():
    kb = KnowledgeBase([('i', 'like', 'cookies'), ('i', 'like', 'milk'),
                        ('i', 'type', 'person'), ('i', 'type', 'living_thing'),
                        ('cookies', 'quality', 'good')])
    assert kb.query('i', 'like', 'quality') == {'good'}