Implementing word-context matrix for term similarity