Python: Dictionary: Common Word

Write the function common_word that takes the file path to a text file (.txt) and an integer n and returns nth common word in the text file. Assume the words in the string are separated by white-space and they are case-insensitive. If multiple words are identified as the nth common word, they must be returned as a single string sorted alphabetically in reverse order and comma separated.


filepath = 'jim-rohn.txt'
common_word(filepath, 2) -> 'small'
common_word(filepath, 1) -> 'you.,others,not,let,but'

Test 1    

Test 2    

Test 3    

Test 4    

Test 5