-- Feb 22 In-Class Exercise Thread
d1 = "All the king's horses and all the king's men"
d2 = "Which is correct: all of the people, all the people, or all people?"
calculating rankProximity("all", "the", 2) we get,
In the case of d1:
[u, v] = [0, 1], [1, 5], [5, 6]
score = 0, d = 1, j = 0
score1 = 0 + (1/2) = 0.5
score2 = 0.5 + (1/5) = 0.7
score3 = 0.7 + 0.5 = 1.2
result[1] = {docid = 1, score = 1.2}
In the case of d2:
[u,v] = [3,5], [5,7], [7,8], [8,11]
score = 0, d = 2, j = 1
score1 = 0 + 0.33 = 0.33
score2 = 0.33 + 0.33 = 0.66
score3 = 0.66 + 0.5 = 1.166
score4 = 1.166 + 0.25 = 1.416
result[2] = {docid = 2, score = 1.416}
After sorting based on score,
result = [{docid = 2, score = 1.416}, {docid = 1, score = 1.2}]
d1 = "All the king's horses and all the king's men"
d2 = "Which is correct: all of the people, all the people, or all people?"
calculating rankProximity("all", "the", 2) we get,
In the case of d1:
[u, v] = [0, 1], [1, 5], [5, 6]
score = 0, d = 1, j = 0
score1 = 0 + (1/2) = 0.5
score2 = 0.5 + (1/5) = 0.7
score3 = 0.7 + 0.5 = 1.2
result[1] = {docid = 1, score = 1.2}
In the case of d2:
[u,v] = [3,5], [5,7], [7,8], [8,11]
score = 0, d = 2, j = 1
score1 = 0 + 0.33 = 0.33
score2 = 0.33 + 0.33 = 0.66
score3 = 0.66 + 0.5 = 1.166
score4 = 1.166 + 0.25 = 1.416
result[2] = {docid = 2, score = 1.416}
After sorting based on score,
result = [{docid = 2, score = 1.416}, {docid = 1, score = 1.2}]