[12.10.20] Testing
This commit is contained in:
parent
f11b94df52
commit
fe90e08191
@ -125,22 +125,32 @@ def processTweet(text, type):
|
|||||||
removedSpecialChars = cleanTweet(removedLines)
|
removedSpecialChars = cleanTweet(removedLines)
|
||||||
removedSpacing = removeSpacing(removedSpecialChars[0])
|
removedSpacing = removeSpacing(removedSpecialChars[0])
|
||||||
tweetLength = checkLength(removedSpacing)
|
tweetLength = checkLength(removedSpacing)
|
||||||
|
|
||||||
|
log("Boop1", 'DEBUG')
|
||||||
if tweetLength == True:
|
if tweetLength == True:
|
||||||
|
|
||||||
checkIfEnglish = detectLaguage(removedSpecialChars[0])
|
checkIfEnglish = detectLaguage(removedSpecialChars[0])
|
||||||
|
log("Boop2", 'DEBUG')
|
||||||
|
|
||||||
if checkIfEnglish == True:
|
if checkIfEnglish == True:
|
||||||
|
|
||||||
tweetText = remove_non_ascii(removedSpacing)
|
tweetText = remove_non_ascii(removedSpacing)
|
||||||
|
log("Boop3", 'DEBUG')
|
||||||
|
|
||||||
# log("Cleaned Tweet: {}".format(tweetText), 'INFO')
|
# log("Cleaned Tweet: {}".format(tweetText), 'INFO')
|
||||||
|
|
||||||
cleanedTweet = tweetText + ' ' + removedSpecialChars[1]
|
cleanedTweet = tweetText + ' ' + removedSpecialChars[1]
|
||||||
|
|
||||||
if callSpamFilter(cleanedTweet) != 'spam':
|
if callSpamFilter(cleanedTweet) != 'spam':
|
||||||
|
log("After spam call", 'DEBUG')
|
||||||
|
|
||||||
pos, neu, neg, compound = callSentimentAnalyser(cleanedTweet)
|
pos, neu, neg, compound = callSentimentAnalyser(cleanedTweet)
|
||||||
|
|
||||||
|
log("After Sentiment Call", 'DEBUG')
|
||||||
|
|
||||||
if compound != 0.0 | neu <= 0.8:
|
if compound != 0.0 | neu <= 0.8:
|
||||||
|
log("if not 0.0 or above 0.8", 'DEBUG')
|
||||||
|
|
||||||
hourTweet = {'pos': pos, 'neu': neu, 'neg': neg, 'compound': compound, 'type': type}
|
hourTweet = {'pos': pos, 'neu': neu, 'neg': neg, 'compound': compound, 'type': type}
|
||||||
|
|
||||||
hourStack.append(hourTweet)
|
hourStack.append(hourTweet)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user