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)
        for o in n[:5]:
            ft_1.add(o)
            
    ft_2 = set() // all related words with second sentence
    for x in second:
        ft_2.add(x)
        n, _ = nearby(x)

After Change


    s1_len, s2_len = len(s1), len(s2)
    maxlen = s1_len
    if s1_len == s2_len:
        first, second = sorted([s1, s2])
    elif s1_len < s2_len:
        first = s1
        second = s2
        maxlen = s2_len
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: pantsbuild/pants
Commit Name: 6229c419d8f1b63cac22f23f24e19ef28d89b0a3
Time: 2018-06-27
Author: dawagner@gmail.com
File Name: src/python/pants/backend/graph_info/tasks/cloc.py
Class Name: CountLinesOfCode
Method Name: console_output


Project Name: pantsbuild/pants
Commit Name: fea0351e92bf4f060371ad62907d26ef25c25a50
Time: 2014-10-10
Author: benjy@foursquare.com
File Name: src/python/pants/option/arg_splitter.py
Class Name: ArgSplitter
Method Name: __init__