4a44eff88fe62c76183418e4ffd779f28b973ef3,synonyms/synonyms.py,,_nearby_levenshtein_distance,#Any#Any#,209

Before Change


    s1_len, s2_len = len(s1), len(s2)
    maxlen = max(s1_len, s2_len)
    first, second = (s2, s1) if s1_len == maxlen else (s1, s2)
    ft_1 = set() // all related words with first sentence 
    for x in first:
        ft_1.add(x)
        n, _ = nearby(x)

After Change


    
    scores = []
    for x in second:
        scores.append(max([_levenshtein_distance(x, y) for y in ft]))
    s = np.sum(scores) / maxlen
    return s
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: huyingxi/Synonyms
Commit Name: 4a44eff88fe62c76183418e4ffd779f28b973ef3
Time: 2018-05-27
Author: hailiang.hl.wang@gmail.com
File Name: synonyms/synonyms.py
Class Name:
Method Name: _nearby_levenshtein_distance


Project Name: SINGROUP/dscribe
Commit Name: 097217a383e91ea4d11448a55dff79c748cf641d
Time: 2017-08-08
Author: lauri.himanen@aalto.fi
File Name: describe/utils/stats.py
Class Name:
Method Name: system_stats


Project Name: dgasmith/opt_einsum
Commit Name: 05de336e95320733969c86d22a0bf0ae78d438e0
Time: 2018-06-18
Author: john.gray.14@ucl.ac.uk
File Name: opt_einsum/parser.py
Class Name:
Method Name: parse_einsum_input


Project Name: arviz-devs/arviz
Commit Name: 77fc2272e32e6302d34b80febdc1b8fdf49de61d
Time: 2018-10-27
Author: aloctavodia@gmail.com
File Name: arviz/plots/densityplot.py
Class Name:
Method Name: plot_density