Fixed error
This commit is contained in:
@@ -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','')
|
||||
|
||||
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user