예제 #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
예제 #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
예제 #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")
예제 #4
0
파일: test_en.py 프로젝트: clips/pattern
 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")