Beispiel #1
0
 def test_sentiwordnet(self):
     # Assert < 0 for negative words and > 0 for positive words.
     try:
         from pattern.text.en.wordnet import SentiWordNet
         lexicon = SentiWordNet()
         lexicon.load()
     except ImportError, e:
         # SentiWordNet data file is not installed in default location, stop test.
         print e; return
Beispiel #2
0
 def test_sentiwordnet(self):
     # Assert < 0 for negative words and > 0 for positive words.
     try:
         from pattern.text.en.wordnet import SentiWordNet
         lexicon = SentiWordNet()
         lexicon.load()
     except ImportError, e:
         # SentiWordNet data file is not installed in default location, stop test.
         print e; return
Beispiel #3
0
 def test_sentiwordnet(self):
     # Assert < 0 for negative words and > 0 for positive words.
     try:
         from pattern.text.en.wordnet import SentiWordNet
         lexicon = SentiWordNet()
         lexicon.load()
     except ImportError as e:
         # SentiWordNet data file is not installed in default location, stop test.
         print(e)
         return
     self.assertTrue(lexicon["wonderful"][0] > 0)
     self.assertTrue(lexicon["horrible"][0] < 0)
     print("pattern.en.sentiment.SentiWordNet")
Beispiel #4
0
 def test_sentiwordnet(self):
     # Assert < 0 for negative words and > 0 for positive words.
     try:
         from pattern.text.en.wordnet import SentiWordNet
         lexicon = SentiWordNet()
         lexicon.load()
     except ImportError as e:
         # SentiWordNet data file is not installed in default location, stop test.
         print(e)
         return
     self.assertTrue(lexicon["wonderful"][0] > 0)
     self.assertTrue(lexicon["horrible"][0] < 0)
     print("pattern.en.sentiment.SentiWordNet")