scramblingbalam / F2016_EECS595_NLP

Programing assignments for Natural Language Processing
0 stars 0 forks source link

B1: Parse the input file #4

Closed scramblingbalam closed 7 years ago

scramblingbalam commented 7 years ago

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