The main change is to simplify get_wiki_text to only use the wikipedia module. wikipedia doesn't allow specifying a sentence cutoff, so instead it breaks after the first paragraph. I also added some pep8 changes that I thought improve readability.
I also made some of the loops and conditionals more idiomatic. All of these should be equivalent to what's currently in use, but I wasn't able to test some of them without an account - particularly the changes dealing with file I/O.
Closed this pull request because of some bugs I found after the fact. I've done more work and more thorough testing, and will submit a new pull request with a better write up of the changes I made.
The main change is to simplify
get_wiki_text
to only use thewikipedia
module.wikipedia
doesn't allow specifying a sentence cutoff, so instead it breaks after the first paragraph. I also added some pep8 changes that I thought improve readability.I also made some of the loops and conditionals more idiomatic. All of these should be equivalent to what's currently in use, but I wasn't able to test some of them without an account - particularly the changes dealing with file I/O.