fixed few issues while calculating weighted word similarities