def test_processing(self): if not verbose: print('\n --- Testing function get_sentiment_sad() ----') result = processing.TextProcessor('Initial text').processing() expected = { 'Subject': 'john', 'Predicate': 'live', 'Verbs': ['live', 'bear'], 'Sentance': [ 'john', 'have', 'be', 'live', 'in', 'this', 'city', 'since', 'he', 'be', 'bear' ], 'Sentiment': 'neutral', 'Proper Nouns': ['john'], 'Noun Phrase': ['john'], 'Pronouns': ['he'] } self.assertEqual(result, expected)
def test_get_sentiment_happy(self): if not verbose: print('\n --- Testing function get_sentiment_happy() ----') self.assertEqual( processing.TextProcessor('Initial text').get_sentiment(0.75), 'happy')
def test_get_sentiment_sad(self): if not verbose: print('\n --- Testing function get_sentiment_sad() ----') self.assertEqual( processing.TextProcessor('Initial text').get_sentiment(-0.1), 'sad')
def test_word_tag_adv(self): if not verbose: print('\n --- Testing function word_tag() ----') self.assertEqual( processing.TextProcessor('Initial text').word_tag(['Hello', 'RB']), _wordnet.ADV)