def combine_fids(fids, out_path, task): print('Generating ' + out_path) files = [] for f in fids: if isfile(join(ctb_in_nltk, f)): files.append(f) with open(out_path, 'w') as out: combine_files(files, out, ctb, task, add_s=True)
def combine_fids(fids, out_path): print('Generating ' + out_path) files = [] for fid in fids: f = 'chtb_%04d.fid' % fid if isfile(join(ctb_in_nltk, f)): files.append(f) with open(out_path, 'w') as out: combine_files(files, out, ctb)
def combine(folder_ids, out_path): print('Generating ' + out_path) with open(out_path, 'w') as out: fids = [] for fid in folder_ids: for file in ptb.fileids(): if file.startswith('WSJ/%02d/' % fid): # print(file) fids.append(file) combine_files(fids, out, ptb)
def combine_fids(fids, out_path): print('Generating ' + out_path) files = [] for fid in fids: f = 'chtb_%03d.fid' % fid if fid > 1000: f = 'chtb_%04d.fid' % fid if isfile(join(ctb_in_nltk, f)): files.append(f) with open(out_path, 'w') as out: combine_files(files, out, ctb)
def combine(folder_ids, out_path, task): print('Generating: ' + out_path) print('Section(s): ' + folder_ids.__str__()) with open(out_path, 'w') as out: fids = [] for fid in folder_ids: for file in ptb.fileids(): if file.startswith('WSJ/%02d/' % fid): # print(file) fids.append(file) combine_files(fids, out, ptb, task)