Easy enough. What you need to do is the following :
1) Populate the list with words from the file.
2) Start from the beginning, check if the first word is correct, i.e first letter is capitalized, and spelled correctly.
3) Check if the second word is spelled correclty, if not fix it
4) Check if the second word is now the same as the first word, if so delete it
5) Repeat until the end of the list, for each word in the list.