From 87c48ed499efceda732f79a577047efda5adfe5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Primo=C5=BE=20Godec?=
Date: Thu, 18 Mar 2021 12:53:50 +0100
Subject: [PATCH] Score documents
---
orangecontrib/text/widgets/owdocumentscorer.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/orangecontrib/text/widgets/owdocumentscorer.py b/orangecontrib/text/widgets/owdocumentscorer.py
index 281bfd3b9..ecf26bed0 100644
--- a/orangecontrib/text/widgets/owdocumentscorer.py
+++ b/orangecontrib/text/widgets/owdocumentscorer.py
@@ -252,6 +252,7 @@ def set_data(self, corpus: Corpus):
@Inputs.words
def set_words(self, words: Table):
+ # todo: handle case when no type=words
if words is not None:
self.Warning.missing_words.clear()
words_attr = next(
@@ -297,7 +298,8 @@ def _fill_and_output(self):
def _clear(self):
self.scores = {}
self.cancel()
- self._fill_and_output()
+ if self.corpus is not None:
+ self._fill_and_output()
self.commit()
def _setting_changed(self):