Esempio n. 1
0
def group_sed_in_gor():
    reader = list(csv.reader(open('sed.csv')))
    return group_regions(regions, group_words(lst.transpose(reader)))
Esempio n. 2
0
def transpose_word(word):
    "[{str:[float]}] -> [[{str:float}]]"
    def transpose_segment(seg):
        return [dict(zip(seg.keys(), ns)) for ns in lst.transpose(seg.values())]
    return lst.transpose(map(transpose_segment, word))
Esempio n. 3
0
 def transpose_segment(seg):
     return [dict(zip(seg.keys(), ns)) for ns in lst.transpose(seg.values())]
Esempio n. 4
0
def stringify(zipped):
    print zipped
    return '\n'.join('c(%s)' % ','.join(map(str,ns))
                     for ns in transpose(zipped.values()))