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

return demo_sent_subjectivity instead of print #2901

Closed
wants to merge 2 commits into from

Conversation

andrewlin0
Copy link

I simply changed the output format of the demo_sent_subjectivity to return instead of print to avoid the program to have to run longer because it prints out each. result to the console.

I simply changed the output format of the demo_sent_subjectivity to return instead of print to avoid the program to have to run longer because it prints out each. result to the console.
@tomaarsen
Copy link
Member

The reason the demo_* functions don't tend to return anything, is because they are not meant to be used much. In my opinion, these functions should not even be importable from NLTK. They are only meant to quickly and effectively show how functions/classes in that file can be used.
Because of that, I prefer printing over returning, as it helps with effectively displaying the output.

@tomaarsen
Copy link
Member

#2903 has fixed a broken test case which snuck into this PR. I've merged develop into this PR to resolve this broken test.
That said, this PR still has broken tests from the PR itself. (pre-commit fails because of incorrect formatting, running black or pre-commit run --all-files should solve it)

@tomaarsen
Copy link
Member

I'll be closing this.

@tomaarsen tomaarsen closed this Dec 13, 2021
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.

None yet

2 participants