The word error rate computation for the first HW is in terms of words, not characters. That is, the substitution, insertions and deletions are happening to words not characters. In the following examples, the cost of a substitution is 1 (not 2 as in the Levenshtein distance).
Fortunately (?), the edit distance code I gave you works both ways. It doesn't care about what's in the sequences you pass it. Specifically, if you call it with strings as in
>>> minEditDist("intention", "execution")
5
you get a character level distance because that's what the target and source variable indexes are giving you. If you call with lists of words as in
>>>hyp="theta bled own there".split()
>>> hyp
['theta', 'bled', 'own', 'there']
>>> ref= "the table down there".split()
['the', 'table', 'down', 'there']
>>> minEditDist(hyp, ref)
3
then you get a word level edit distance.
To get the WER from that you need to divide by the length of the gold standard answer.
>>> float(minEditDist(hyp,ref))/len(ref)
.75
You have to float the distance so you don't get an integer divide.
