implementation of Weighted Lev. Distance and Jaccard Distance