Conversation
SeunginLyu
left a comment
There was a problem hiding this comment.
Nicely Done! Your code is functional and is concise stylistically. But I feel like you can improve your documentation by adding more inline comments and clarifying some of your docstrings. I've also made minor stylistic suggestions for revision!
|
|
||
| def gettext(url): | ||
| """ maybe modify this to incorporate other websites | ||
| if I have the time""" |
There was a problem hiding this comment.
This docstring does not explain what this function is about. Please refer to Oliver's GeneFinder solution. https://github.com/sd17fall/GeneFinder/blob/formatted/gene_finder.py
| return requests.get(url).text | ||
|
|
||
| Christmas = gettext('http://www.gutenberg.org/cache/epub/46/pg46.txt') | ||
| #OliverTwist = gettext('http://www.gutenberg.org/ebooks/730.txt.utf-8') |
There was a problem hiding this comment.
Please remove comments for your final code
| cleanedlist.append(word) | ||
| return cleanedlist | ||
|
|
||
| #print(len(cleanuplist(ATaleofTwoCities))) |
| >>> cleanuplist('This project is so hard!') | ||
| ['this', 'project', 'is', 'so', 'hard'] | ||
| >>> cleanuplist('I need, a bunch, of !? doctest?') | ||
| ['i', 'need', 'a', 'bunch', 'of', 'doctest'] |
| cleanedlist = [] | ||
| textlist = textlist.lower().split() | ||
| for word in textlist: | ||
| symbols = "-_=+[}{]:;?/.>,<?!@#$%^&*()|'" |
There was a problem hiding this comment.
This is a good way of implementing this function. I also suggest you look into regular expression if you want your code to be more concise! https://en.wikipedia.org/wiki/Regular_expression
|
|
||
| #print(topNvalues(wordcounter(ATaleofTwoCities),5)) | ||
|
|
||
| def uniquewordsused(s): |
There was a problem hiding this comment.
one way to make this function name more readable is by using camelcase convention like uniqueWordUsed https://sanaulla.info/2008/06/25/camelcase-notation-naming-convention-for-programming-languages/
|
|
||
| def suffixdictionary(s): | ||
| """ Takes the premade dictionary key index and starts appending | ||
| suffixes to the list of values for each key |
There was a problem hiding this comment.
So what is this function returning? I think you can be more clear with your docstring.
|
Nice, I see improvements in your documentation. I still suggest you to use the style https://github.com/sd17fall/GeneFinder/blob/formatted/gene_finder.py here for function documentation. |
No description provided.