Open karl-project-review opened 6 years ago
I was aware of some of the initials checking limitations, but tested it to make sure it worked for the samples given. A possible expansion of the idea could check the prior word in the string to the initial in question and check to see if it is equivalent to itself with the .title() method and if true would suggest that it is a first name, furthermore suggesting a possible initial following it.
Thank you for your review, and the tip about the library, I actually remembered that there was a list of the uppercase alphabet in the scrabble project that I pasted over instead of typing it.🤣 haha To be honest, I'm unsure and a little iffy on library usage as the instructions on downloading anaconda were very vague and I kind of winged it. Do you need to download the modules, or are they included with anaconda so you can import them if you know of their existence?
Also, do you have a good reference for information on modules, or is most of it covered in the python documentation?
The standard Python modules should be included in the Anaconda download. Here is a listing of them (from the Python documentation), which you may want to browse through just to see what kind of stuff is there: https://docs.python.org/3/py-modindex.html Also (generally) included in Anaconda are the NumPy and SciPy libraries, which you can read more about here: https://docs.scipy.org/doc/ The Python community has a developed a lot of other miscellaneous libraries that are not included in Anaconda, though, so if there is a particular area of coding you are interested in (game design, a particular discipline of scientific computing, etc), it might be worth doing a web search to see if there is a reputable, open source Python library related to that subject as well.
Rubric Score
Criteria 1: Valid Python Code
Criteria 2: Implementation of Project Requirements
Criteria 3: Software Architecture
Criteria 4: Uses Python Language Features
Note that this method is not necessarily better; just shorter.
Criteria 5: Produces Accurate Output
Overall Score: 20/20 (Exceeds Expectations)
Outstanding job! All of your code works as it should, it is all reasonably efficient, and you clearly tested your functions (judging from the commented out print statements), which is an important part of the coding process. Also, your comment about adding weights to the various similarity indicators is a good one, as naturally some are better indicators of true similarity than others. Indeed, ideally the n-gram and word frequency functions would also incorporate weights, as some word choices are more idiosyncratic than others and are more telling than an unweighted comparison, particularly in relatively short samples like these. Nice work thinking through the limitations of the assignment spec and how it could be improved! Since you clearly have the Python basics down, I will pose an additional challenge for you to think about. In your get_average_sentence_length function, the method for eliminating the periods after initials works well enough for the provided text sample. However, it could run into problems if a sentence ended with a single capital letter (for example: "He fit the description to a T." or "Who did it? Gregg and I."). Also, it could have difficulties if someone were to end a sentence with a period while writing in all caps (in the samples, the all caps sections ended with exclamation points and question marks, but what if they did not?) Can you think of an approach that would account for these possibilities? (This is definitely well above the expectations for this course, but it is an interesting challenge to think about). Again, great work!