Example #1
0
	def getTweetSenticScore(self, tweet):
		words = preprocessTweet(tweet)
		wordcombos = getWordCombinations(words, " ")
		total = SenticScore(0.0, 0.0, 0.0, 0.0, 0.0)
		count = 0

		for w in wordcombos:
			obj = self.getWordSenticScore(w)
			if obj != None:
				total.add(obj)
				count = count + 1
		
		if count > 0:
			return total
		else:
			return None
Example #2
0
    def getTweetScore(self, tweet):
        words = preprocessTweet(tweet)
        wordcombos = getWordCombinations(words, "_")
        total = 0.0
        count = 0
        for w in wordcombos:
            ret = self.getWordScore(w)
            if (ret != None):
                total = total + ret
                count = count + 1

        if (count > 0):
            #calculate average
            average = total / count
            return average
        else:
            return None
Example #3
0
	def getTweetScore(self, tweet):
		words = preprocessTweet(tweet)
		wordcombos = getWordCombinations(words, "_")
		total = 0.0
		count = 0
		for w in wordcombos:
			ret = self.getWordScore(w)
			if(ret != None):
				total = total + ret
				count = count + 1

		if(count > 0):
			#calculate average
			average = total/count
			return average
		else:
			return None