Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
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)
Пример #4
0
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)
Пример #5
0
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)