def put_test()

in tasks/hierar-or-linear/generate_data.py [0:0]


def put_test(root, depth_from, depth_to):
    with open(f'{root}/test.src', 'w') as test_src, open(f'{root}/test.dst', 'w') as test_tgt:
        for d in range(depth_from, depth_to):
            for central_symbol, wrapper in itertools.product(['a', 'b'], ['a', 'b']):
                train_input = [wrapper] * d + [central_symbol] + [wrapper] * d
                print(' '.join(train_input), file=test_src)
                print('', file=test_tgt) # not used
                
    shutil.copy(f'{root}/test.src', f'{root}/valid.src')
    shutil.copy(f'{root}/test.dst', f'{root}/valid.dst')