def _approximate_bias(b, name):
    """
    Find a reasonable match for the given name when we have existing biases in gazetteer entry.
    Otherwise if the name is just long enough it should be rather unique and return a high bias ~ 0.3-0.5

    If a name varies in length by a third, we'll approximate the name bias to be similar.

    :param b: dict of name:bias
    :param name: normalize name
    :return:
    """
    if name in b:
        return b.get(name)
    nmlen = len(name)
    diff = int(nmlen / 3)
    for n in b:
        nlen = len(n)
        if abs(nmlen - nlen) < diff:
            return b.get(n)
    if nmlen >= 20:
        return 0.40
    return 0.05