示例#1
0
文件: hielo.py 项目: sandersn/dialect
def graph(edges, iterations):
    return dct.collapse_pairs(significants(edges, iterations))
示例#2
0
文件: hielo.py 项目: sandersn/dialect
def directed(graph):
    return dct.collapse_pairs(concat([[(k, v), (v, k)] for k in graph for v in graph[k]]))
示例#3
0
def groupby(speakerfile, index, delimiter='\t'):
    "12 is birthplace, 14 is education level; 1 is filename, 3 is speaker code"
    return dct.collapse_pairs([(x[index],(x[1],x[3]))
                               for x in csv.reader(open(speakerfile),
                                                   delimiter=delimiter)][1:])