MCPcopy Index your code
hub / github.com/clips/pattern / test_dict

Method test_dict

test/test_text.py:116–123  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

114 pass
115
116 def test_dict(self):
117 # Assert weighted average polarity and subjectivity for dictionary.
118 s = text.Sentiment()
119 v = {":-(": 3, ":-)": 1}
120 self.assertEqual(s(v)[0], -0.5)
121 self.assertEqual(s(v)[1], +1.0)
122 self.assertEqual(s(v).assessments[0], ([":-("], -1.0, 1.0))
123 self.assertEqual(s(v).assessments[1], ([":-)"], +1.0, 1.0))
124
125 def test_bag_of_words(self):
126 # Assert weighted average polarity and subjectivity for bag-of-words with weighted features.

Callers

nothing calls this directly

Calls 1

sFunction · 0.85

Tested by

no test coverage detected