From 9cbbb45035b69a86a24a9e7af33c48fa624ad224 Mon Sep 17 00:00:00 2001 From: anheyman Date: Sat, 26 Oct 2019 00:31:18 +0200 Subject: [PATCH] define __getnewargs__(self) of Score in order to make it serializable(pickle) --- pattern/text/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pattern/text/__init__.py b/pattern/text/__init__.py index aa77af0b..2f0be904 100644 --- a/pattern/text/__init__.py +++ b/pattern/text/__init__.py @@ -2312,7 +2312,9 @@ def __new__(self, polarity, subjectivity, assessments=[]): def __init__(self, polarity, subjectivity, assessments=[]): self.assessments = assessments - + def __getnewargs__(self): + return self[0], self[1] + class Sentiment(lazydict): def __init__(self, path="", language=None, synset=None, confidence=None, **kwargs):