-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OWConcordance: new output #371
Conversation
Codecov Report
@@ Coverage Diff @@
## master #371 +/- ##
=======================================
Coverage 85.32% 85.32%
=======================================
Files 34 34
Lines 1881 1881
Branches 337 337
=======================================
Hits 1605 1605
Misses 237 237
Partials 39 39 |
@@ -129,6 +132,7 @@ def data(self, index, role=Qt.DisplayRole): | |||
const = self.word_index[row][0] in self.colored_rows | |||
return QColor(236 + 19 * const, 243 + 12 * const, 255) | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Between methods should be only one empty line
docs = [] | ||
for row in range(self.rowCount()): | ||
data.append([]) | ||
docs.append([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary to first append empty table and then override it. Just append the final one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then data[row].append(str(self.data(index)))
won't work. How do I fill the table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a temporary table to append str(self.data(index))
and then append [" ".join(tmp)]
to data
. For docs
you can directly append [self.corpus.titles[self.word_index[row][0]]]
to it.
data[row].append(str(self.data(index))) | ||
data[row] = [" ".join(data[row])] | ||
docs[row] = [self.corpus.titles[self.word_index[row][0]]] | ||
return(Corpus.from_list(domain, np.column_stack((data, docs)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return
is not a function
data[row].append(str(self.data(index))) | ||
data[row] = [" ".join(data[row])] | ||
docs[row] = [self.corpus.titles[self.word_index[row][0]]] | ||
return(Corpus.from_list(domain, np.column_stack((data, docs)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from_list
is inherited from Table
and doesn't correctly initializes Corpus
. Use from_table
063eb48
to
1f136be
Compare
@robertcv This is ready for another look. |
Issue
Implements #317.
Description of changes
Introduced new output Concordances, which displays the results of Concordance in a Table (which means it can also be saved with Save Data).
Includes