Skip to content
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

Merged
merged 3 commits into from
Sep 11, 2018
Merged

Conversation

ajdapretnar
Copy link
Collaborator

@ajdapretnar ajdapretnar commented Aug 9, 2018

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
  • Code changes
  • Tests
  • Documentation

@codecov-io
Copy link

codecov-io commented Aug 9, 2018

Codecov Report

Merging #371 into master will not change coverage.
The diff coverage is n/a.

@@           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

@ajdapretnar ajdapretnar requested a review from robertcv September 6, 2018 10:01
@@ -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)


Copy link
Collaborator

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([])
Copy link
Collaborator

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.

Copy link
Collaborator Author

@ajdapretnar ajdapretnar Sep 6, 2018

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?

Copy link
Collaborator

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))))
Copy link
Collaborator

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))))
Copy link
Collaborator

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

@ajdapretnar
Copy link
Collaborator Author

@robertcv This is ready for another look.

@robertcv robertcv merged commit b48dbc9 into biolab:master Sep 11, 2018
@ajdapretnar ajdapretnar deleted the new-output-conc branch January 21, 2021 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants