Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

likeliness python

def similar(w1, w2):
    w1 = w1 + ' ' * (len(w2) - len(w1))
    w2 = w2 + ' ' * (len(w1) - len(w2))
    return sum(1 if i == j else 0 for i, j in zip(w1, w2)) / float(len(w1))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #likeliness #python
ADD COMMENT
Topic
Name
9+3 =