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

Method test_sentiwordnet

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

Source from the content-addressed store, hash-verified

936 print "pattern.en.subjectivity()"
937
938 def test_sentiwordnet(self):
939 # Assert < 0 for negative words and > 0 for positive words.
940 try:
941 from pattern.text.en.wordnet import SentiWordNet
942 lexicon = SentiWordNet()
943 lexicon.load()
944 except ImportError, e:
945 # SentiWordNet data file is not installed in default location, stop test.
946 print e; return
947 self.assertTrue(lexicon["wonderful"][0] > 0)
948 self.assertTrue(lexicon["horrible"][0] < 0)
949 print "pattern.en.sentiment.SentiWordNet"
950
951#---------------------------------------------------------------------------------------------------
952

Callers

nothing calls this directly

Calls 2

loadMethod · 0.95
SentiWordNetClass · 0.90

Tested by

no test coverage detected