Skip to content

Commit

Permalink
OWCorpusViewer: Change input to Corpus
Browse files Browse the repository at this point in the history
  • Loading branch information
nikicc committed Aug 18, 2017
1 parent 186f47d commit ff1c3e1
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions orangecontrib/text/widgets/owcorpusviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
QAbstractItemView, QHeaderView, QSplitter,
QApplication)

from Orange.data import Table
from Orange.data.domain import filter_visible
from Orange.widgets import gui, widget
from Orange.widgets.settings import Setting, ContextSetting, PerfectDomainContextHandler
Expand All @@ -24,7 +23,7 @@ class OWCorpusViewer(OWWidget):
priority = 500

class Inputs:
data = Input("Data", Table)
corpus = Input("Corpus", Corpus)

class Outputs:
matching_docs = Output("Matching Docs", Corpus, default=True)
Expand Down Expand Up @@ -123,15 +122,13 @@ def copy_to_clipboard(self):
text = self.doc_webview.selectedText()
QApplication.clipboard().setText(text)

@Inputs.data
def set_data(self, data=None):
@Inputs.corpus
def set_data(self, corpus=None):
self.closeContext()
self.reset_widget()
self.corpus = data
self.corpus = corpus
self.search_features = []
if data is not None:
if not isinstance(data, Corpus):
self.corpus = Corpus.from_table(data.domain, data)
if corpus is not None:
domain = self.corpus.domain
# Enable/disable tokens checkbox
if not self.corpus.has_tokens():
Expand Down

0 comments on commit ff1c3e1

Please sign in to comment.