blob: ee56ee9463500f3dc14af810a9854f494764d614 [file] [log] [blame]
import glob
from collections import defaultdict
DEREKO_DIR = "/export/netapp/kupietz/N-GRAMM-STUDIE/conllu/"
def get_filenames(data_dir):
filenames = []
for filepath in glob.iglob(f'{data_dir}/*.conllu.gz', recursive=False):
fname = filepath.split("/")[-1]
filenames.append(fname)
return sorted(filenames)
if __name__ == "__main__":
file_groups = defaultdict(list)
filenames = get_filenames(DEREKO_DIR)
for fn in filenames:
prefix = fn.split(".")[0]
file_groups[prefix].append(fn)
for group,files in file_groups.items():
print(group, len(files))