caculate similarity of strings