(a, b)
return r
Returns the relative distance between two strings, in the range
    [0-1] where 1 means total equality.
Returns the relative distance between two strings, in the range
    [0-1] where 1 means total equality.
Returns the relative distance between two strings in the range [ 0 - 1 ] where 1 means total equality .
def relative(a, b):
    """Returns the relative distance between two strings, in the range
    [0-1] where 1 means total equality.
    """

    d = distance(a, b)
    longer = float(max((len(a), len(b))))
    shorter = float(min((len(a), len(b))))
    r = ((longer - d) / longer) * (shorter / longer)
    return r
def relative ( a , b ) : d = distance ( a , b ) longer = float ( max ( ( len ( a ) , len ( b ) ) ) ) shorter = float ( min ( ( len ( a ) , len ( b ) ) ) ) r = ( ( longer - d ) / longer ) * ( shorter / longer ) return r