First part of #3
First, implement parseFile.
This function will be given the name of a file that contains a
word pair and a similarity score on each line. To see an example of the format of the file, look at
input.txt.
Your function should read in the file and return an ordered dictionary of (word1,
word2): score entries. Make sure that you represent your scores as floats.
First part of #3 First, implement parseFile. This function will be given the name of a file that contains a word pair and a similarity score on each line. To see an example of the format of the file, look at input.txt.
Your function should read in the file and return an ordered dictionary of (word1, word2): score entries. Make sure that you represent your scores as floats.
Hint: You can find out more about file I/O in Python here: https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files