(1st-April-2020)
The mapping function in Algorithm-III first tests whether any token is null. In such a case the mapping is zero. On the other hand, if both tokens are lexically same then in that case the mapping is 1. Similarly, if the semantic data retrieved from Wordnet for each token is lexically same then in that case also the mapping is 1. The functionality of Algorithm-III is utilized for semantic similarity.
ALGORITHM-III: Tokens Mapping Function
1: procedure MAPPING (token1, token2)
2: if token1.length = 0
3: return 0
4: else if token2.length = 0
5: return 0
6: end if
7: if token1 = token2
8: return 1
9: end if
10: token1SenseList ← GetWordnetSenses(token1)
11: token2SenseList ← GetWordnetSenses(token2)
12: for each token1Sense in token1SenseList
13: for each token2Sense in token2SenseList
14: if(token1Sense = token2Sense)
15: return 1
16: end if
17: end for
18: end for
19: end procedure
Comments