Merge pull request #7 from lambertrego/Sentistrength

Update __init__.py
This commit is contained in:
Yong Zhun Hung
2020-03-23 15:39:34 +08:00
committed by GitHub
+2 -5
View File
@@ -37,11 +37,8 @@ class PySentiStr:
stdout_text = stdout_text.rstrip().replace("\t"," ")
stdout_text = stdout_text.replace('\r\n','')
senti_score = stdout_text.split(' ')
try:
senti_score = list(map(float, senti_score))
except ValueError:
raise ValueError("SentiStrengthLanguageFolderPath is set as '{}'. Ensure it is correct and ends with a forward slash '/'".format( self.SentiStrengthLanguageFolder))
senti_score = list(map(float, senti_score))
senti_score = [int(i) for i in senti_score]
if score == 'scale': # Returns from -1 to 1