MCPcopy Create free account
hub / github.com/clips/pattern / test_similarity

Method test_similarity

test/test_graph.py:685–692  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

683 print "pattern.graph.commonsense.Commonsense.field()"
684
685 def test_similarity(self):
686 # Assert that tiger is more similar to lion than to spoon
687 # (which is common sense).
688 g = commonsense.Commonsense()
689 w1 = g.similarity("tiger", "lion")
690 w2 = g.similarity("tiger", "spoon")
691 self.assertTrue(w1 > w2)
692 print "pattern.graph.commonsense.Commonsense.similarity()"
693
694#---------------------------------------------------------------------------------------------------
695

Callers

nothing calls this directly

Calls 1

similarityMethod · 0.95

Tested by

no test coverage detected