-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_tool
More file actions
executable file
·39 lines (27 loc) · 794 Bytes
/
Copy pathcheck_tool
File metadata and controls
executable file
·39 lines (27 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python
# interactive CLI for annotation verification
# this program is not usable yet
from argparse import ArgumentParser
from annotation_file import annotation_parse
from dataclasses import dataclass
import sys
@dataclass
class UncheckedLocation:
line: int
idx: int
def main():
ap = ArgumentParser()
ap.add_argument('annotation_file')
args = ap.parse_args()
with open(args.annotation_file, 'r') as f:
af = annotation_parse(f.read())
todo = []
for lidx, dialogue in enumerate(af.lines):
for aidx, annotation in enumerate(dialogue.fragments):
if annotation.checked or annotation.unfinished:
continue
todo.append(UncheckedLocation(line=lidx, idx=aidx))
if len(todo) == 0:
print('Nothing to do.')
sys.exit(0)
main()