Fixed error

This commit is contained in:
zhunhung
2019-04-05 13:07:06 +08:00
parent 59c0a5ce02
commit 1e59b2e889
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -7,7 +7,7 @@ from os import getcwd
class PySentiStr:
def __init__(self):
pass
pass
# self.SentiStrengthLocation = os.path.join(getcwd(),"SentiStrength.jar")
# self.SentiStrengthLanguageFolder = os.path.join(getcwd(),"SentiStrengthData/")
@@ -19,12 +19,12 @@ class PySentiStr:
self.SentiStrengthLanguageFolder = sslf_Path
def getSentiment(self, df_text, score='scale'):
if not hasattr(self, 'SentiStrengthLocation'):
print("Set path using setSentiStrengthPath(path) function.")
if not hasattr(self, 'SentiStrengthLanguageFolder'):
print("Set path using setSentiStrengthLanguageFolderPath(path) function.")
if not hasattr(self, 'SentiStrengthLocation'):
assert False, "Set path using setSentiStrengthPath(path) function."
if not hasattr(self, 'SentiStrengthLanguageFolder'):
assert False, "Set path using setSentiStrengthLanguageFolderPath(path) function."
# Able to take in single string or list of string and convert into pandas Series
if type(df_text) != pd.Series:
df_text = pd.Series(df_text)
df_text = df_text.str.replace('\n','')
+1 -1
View File
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="sentistrength",
version="0.0.1",
version="0.0.3",
author="Zhun Hung",
author_email="yongzhunhung@gmail.com",
description="Python 3 Wrapper for SentiStrength, reads a single or multiple input with options for binary class or scale output.",