Example #1
0
def part_path(id, dir, set, part):
    return join_path(dir, set, 'book_%s.%s' % (id, part))
Example #2
0
def load_id(id, dir):
    path = join_path(dir, '%s.txt.iob' % id)
    lines = load_lines(path)
    return parse_conll(lines)
Example #3
0
def list_ids(dir, set):
    for filename in list_dir(join_path(dir, set)):
        match = re.match(r'^book_(\d+)\.txt$', filename)
        if match:
            yield match.group(1)
Example #4
0
def ann_path(id, dir):
    return join_path(dir, '%s.ann' % id)
Example #5
0
def txt_path(id, dir):
    return join_path(dir, '%s.txt' % id)
Example #6
0
def objects_path(id, dir, set):
    return join_path(dir, set, 'book_%s.objects' % id)
Example #7
0
def spans_path(id, dir, set):
    return join_path(dir, set, 'book_%s.spans' % id)
Example #8
0
def txt_path(id, dir, set):
    return join_path(dir, set, 'book_%s.txt' % id)