Пример #1
0
def make_labelled_csv(source_csv_filename, output_csv_filename, headline_dict, support_dict):
                                              
    # open csv
    gen_in = yield_csv_rows(source_csv_filename)
    # produce new rows    
    gen_out = yield_row_with_labels(gen_in, headline_dict, support_dict)
    # save to file    
    dump_iter_to_csv(gen_out, output_csv_filename)
Пример #2
0
def make_labelled_csv(f, headline_dict, support_dict):
    infile = get_raw_csv_filename(f)
    outfile = get_labelled_csv_filename(f)
    # open csv
    gen_in = yield_csv_rows(infile)
    # produce new rows    
    gen_out = yield_row_with_labels(gen_in, headline_dict, support_dict)
    # save to file    
    dump_iter_to_csv(gen_out, outfile)
    return outfile 
Пример #3
0
def get_labelled_rows_from_incoming_generator(f, gen_in):
    headline_dict, support_dict = get_dicts(f)
    return yield_row_with_labels(gen_in, headline_dict, support_dict)