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

Method test_sentiwordnet

test/test_en.py:1018–1030  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1016 print "pattern.en.wordnet.map32"
1017
1018 def test_sentiwordnet(self):
1019 # Assert SentiWordNet is loaded correctly.
1020 if en.wordnet.sentiwordnet is None:
1021 return
1022 try:
1023 en.wordnet.sentiwordnet.load()
1024 except ImportError:
1025 return
1026 v = en.wordnet.synsets("anguish")[0]
1027 self.assertEqual(v.weight, (-0.625, 0.625))
1028 v = en.wordnet.synsets("enzymology")[0]
1029 self.assertEqual(v.weight, (0.125, 0.125))
1030 print "pattern.en.wordnet.sentiwordnet"
1031
1032#---------------------------------------------------------------------------------------------------
1033

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected