jabb1123/SoftwareDesign — pull request #3 by abekim (2014-03-13 22:15:31+00:00)
Title: Graded Homework 5

##### Grade: 3.1/5

Hey @ksuzy31 & @jabb1123, I like what you guys tried to accomplish here, but it's hard to see how your code reflects what you tried to do. Here's the biggest question - what are you trying to accomplish with this? As in, to what end are you comparing `word1` and `word2`? If it's my misunderstanding then I'd be happy to give you some of the points back!

As for your code, here are a few comments:
1. The issue you had with replacing specific prepositions like `'a'` or `'an'` is due to the nature of replace. Instead of replacing the occurrence of these prepositions in word `x` in `parse_through_text`, you should check if word `x` is `'a'` or `'an'`. One way of doing it is using `filter` to filter out all the words that are in the list of words you want to delete. That should remove that issue for you.
2. Awesome use of regex and map functions! However, you have 10+ lines where you call map on the word `x`, as a part of your list of words (which actually is just a string). I think it's because you weren't familiar with `string.replace` and `map`. In your case, the better way to write `parse_through_text` is:
```
# parse_through_text without worrying about things like 'a' or 'an'
def parse_through_text (text, delete):
''' remove all occurrences of words in delete in text '''
return map(lambda word_to_be_deleted: text.replace(word_to_be_deleted, ''), delete)

# parse_through_text with advice from #1
def parse_through_text (text, delete):
''' remove all occurrences of words in delete in text '''
return filter(lambda word_in_text: return word_in_text not in delete, text)
```
3. You should have used a dictionary to map a word to the number of occurrences in the text file. That would have made your `Compare_number_of_occurrances` much much easier to write.
4. DOCSTIRNGS - where are they? :-(
5. This one's a bit nitpicky; the first letter of class names (objects) should be capitalized. The first letter of functions, however, should never be capitalized.

Once you've read the comments, make a comment to the pull request or send me/Diana an email, letting us know that you've checked them out. Afterwards, close the PR (and optionally delete the graded branch). Once we get your confirmation, we'll add **0.5** to your current grade.

#### REMEMBER NOT TO MERGE THESE PRs!