Conversation
runnersaw
left a comment
There was a problem hiding this comment.
This review is intended to help you with writing readable and understandable code, not to evaluate or improve the functionality of your code.
In addition to the comments I made below, improving the names of your variables to allow a user to see what they are would be good.
| "from pattern.web import *\n", | ||
| "import string\n", | ||
| "\n", | ||
| "christianity=URL(\"http://www.gutenberg.org/cache/epub/8294/pg8294.txt\").download()\n", |
There was a problem hiding this comment.
You can move the declaration of the variable to the line before you process them, such as:
christianity=URL("http://www.gutenberg.org/cache/epub/8294/pg8294.txt").download()
process_file(christianity)
This improves the readability of your code by grouping related things.
| " if wordss in dic:\n", | ||
| " dic[wordss] += 1\n", | ||
| " else:\n", | ||
| " dic [wordss] = 1\n", |
There was a problem hiding this comment.
Best practice is to not put a space before the square brackets here.
| "\n", | ||
| "\n", | ||
| " \n", | ||
| "def process_file(filename):\n", |
There was a problem hiding this comment.
It would be good to add a comment describing what this function does at the top of the function, such as:
def process_file(file):
'''
This function does something blah blah
'''
code here...
|
This is some final feedback about your project. Overall, your report answered every question that was asked of you. Your answers were somewhat short, but given the brevity of the code and the scope of the project, I’m not sure that there was much more for you to say. The code runs without modification. However, there is a mistake where you do the following: This means that it only returns the top result, rather than printing or returning the top number of results. Changing this to a print, or printing There isn’t a single comment or docstring in your code. Your code is minimal and organized well. Variable names could use improvement. You redefine a function unnecessarily (you can define the function once, and then use it multiple times). |
No description provided.