示例#1
0
def test_conceptfeature():
    from csc.divisi.flavors import ConceptByFeatureMatrix
    mat = ConceptByFeatureMatrix()
    mat.add_triple(('dog', 'IsA', 'pet'), 1.5)
    eq_(mat['dog', ('right', 'IsA', 'pet')], 1.5)
    eq_(mat['pet', ('left', 'IsA', 'dog')], 1.5)
    eq_(len(mat), 2)
示例#2
0
def test_conceptfeature():
    from csc.divisi.flavors import ConceptByFeatureMatrix
    mat = ConceptByFeatureMatrix()
    mat.add_triple(('dog', 'IsA', 'pet'), 1.5)
    eq_(mat['dog', ('right', 'IsA', 'pet')], 1.5)
    eq_(mat['pet', ('left', 'IsA', 'dog')], 1.5)
    eq_(len(mat), 2)