Creating Dictionary from Poem.txt for number of words - Correction to the Week 5 Exercise -

Dear All,
Good Morning. I hope all are doing well and safe. I just wanted to share my experience this weekend.

I was just playing around with this exercise again. I found a small issue with the results.
As per the code demonstrated we should have 222 words. I just re-validate code checked source poem.txt using MS Word and Excel. it should be 221 - Considering some other criteria’s.

The root cause of the issue in removing the special characters. The poem.txt had the word “man’s”. To remove the special character we added space. Hence “man” and “s” became two different words.

Learning is we should be careful in doing these changes. Another observation on words like “pole-star” and “age-old” should we consider this as two words or a single word like “pole” and “star”. When we remove the special character it became two words.

I thought of sharing with you all. it was good learning when revisited and played around the code and source file.

Thanks & Regards
Saravanan Shanmugham