1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-08-24 02:22:20 +00:00

Better NIF compliance

This commit is contained in:
J. Fernando Sánchez
2014-12-01 09:38:23 +01:00
parent 4351f76b60
commit 10f4782ad7
6 changed files with 20 additions and 16 deletions

View File

@@ -35,8 +35,12 @@ class Sentiment140Plugin(SentimentPlugin):
polarity = "marl:Positive"
elif polarity_value < 50:
polarity = "marl:Negative"
entry = Entry(text=params["input"])
opinion = Opinion(hasPolarity=polarity, polarityValue=polarity_value)
entry = Entry(text=params["input"],
prefix=params.get("prefix", ""))
opinion = Opinion(hasPolarity=polarity,
polarityValue=polarity_value,
prefix=params.get("prefix", ""))
opinion["prov:wasGeneratedBy"] = self.id
entry.opinions.append(opinion)
entry.language = lang
response.entries.append(entry)