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

Fix #851, Error is raised instead of returning text [WiP] #902

Merged
merged 6 commits into from
Sep 29, 2016
Merged

Fix #851, Error is raised instead of returning text [WiP] #902

merged 6 commits into from
Sep 29, 2016

Conversation

metalaman
Copy link
Contributor

No description provided.

Return statement removed and error raised.
Removed test for single sentence input.
@metalaman metalaman changed the title Fix #851, Error is raised instead of returning text Fix #851, Error is raised instead of returning text [WiP] Sep 29, 2016
@tmylk
Copy link
Contributor

tmylk commented Sep 29, 2016

Please add a test that exception is raised

@tmylk tmylk merged commit 1c34dfc into piskvorky:develop Sep 29, 2016
@tmylk
Copy link
Contributor

tmylk commented Sep 29, 2016

Thanks for the improvement!

@metalaman metalaman deleted the Summarize,ZeroDivError branch September 29, 2016 14:11
harshuljain13 pushed a commit to harshuljain13/gensim that referenced this pull request Sep 30, 2016
…iskvorky#902)

* Update summarizer.py

Return statement removed and error raised.

* Update test_summarization.py

Removed test for single sentence input.

* Update CHANGELOG.md

* Update summarizer.py

* Update test_wikicorpus.py

* Update test_summarization.py
@@ -97,7 +97,7 @@ def test_text_summarization_returns_input_on_single_input_sentence(self):
# Keeps the first sentence only.
text = text.split('\n')[0]

self.assertEqual(summarize(text),text)
self.assertRaises(ValueError,summarize,text)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8: space after comma.

@@ -87,7 +87,7 @@ def test_text_summarization_raises_exception_on_short_input_text(self):
text = "\n".join(text.split('\n')[:8])

self.assertTrue(summarize(text) is not None)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No trailing whitespace please.

@@ -31,7 +31,7 @@ def setUp(self):


def test_get_texts_returns_generator_of_lists(self):

logger.debug("Current Python Version is "+str(sys.version_info))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8: space around binary operators.

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