1e0683b3f5b56c53d9e75c9722e4adf7891d7361,lingpy/compare/partial.py,Partial,partial_cluster,#Partial#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,336

Before Change


                    for i,(idx,pos,slc) in enumerate(trace):
                        _g.add_node((i,idx,pos))
                    remove_edges = []
                    for i,n1 in enumerate(_g.nodes()):
                        for j,n2 in enumerate(_g.nodes()):
                            if i < j:
                                if C[n1[1]][n1[2]] == C[n2[1]][n2[2]]:
                                    _g.add_edge(n1, n2)
                                    if n1[1] == n2[1]:
                                        // get scores for n1 and n2 with all the rest in
                                        // the matrix to decide for one
                                        sn1, sn2 = 0, 0
                                        for i,row in enumerate(matrix):
                                            sn1 += matrix[i][n1[0]]
                                            sn2 += matrix[i][n2[0]]
                                        sn1 = sn1 / len(matrix)
                                        sn2 = sn2 / len(matrix)
                                        if sn1 <= sn2:
                                            remove_edges += [n2]
                                        else:
                                            remove_edges += [n1]
                    for node in remove_edges:
                        for edge in sorted(_g.edge[node]):
                            _g.remove_edge(node, edge)

After Change


                    for i,(idx,pos,slc) in enumerate(trace):
                        _g.add_node((i,idx,pos))
                    remove_edges = []
                    for (i, n1), (j, n2) in combinations2(enumerate(_g.nodes())):
                        if C[n1[1]][n1[2]] == C[n2[1]][n2[2]]:
                            _g.add_edge(n1, n2)
                            if n1[1] == n2[1]:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: lingpy/lingpy
Commit Name: 1e0683b3f5b56c53d9e75c9722e4adf7891d7361
Time: 2016-04-27
Author: mattis.list@uni-marburg.de
File Name: lingpy/compare/partial.py
Class Name: Partial
Method Name: partial_cluster


Project Name: lingpy/lingpy
Commit Name: fceb1968e44aa10654144aa0ca0a75adc46e13e2
Time: 2016-03-11
Author: xrotwang@googlemail.com
File Name: lingpy/meaning/colexification.py
Class Name:
Method Name: _make_matrix


Project Name: lingpy/lingpy
Commit Name: fceb1968e44aa10654144aa0ca0a75adc46e13e2
Time: 2016-03-11
Author: xrotwang@googlemail.com
File Name: lingpy/meaning/colexification.py
Class Name:
Method Name: _get_colexifications