odt2tei.py
1.05 KB
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
40
41
42
43
44
45
46
47
48
49
"Convert scanned ODT to TEI"
import argparse
from odt2tei.converter import Converter
def parse_options():
parser = argparse.ArgumentParser(description="Convert ODT documents to PCC TEI")
parser.add_argument("filename", nargs="+", help="folder or filename")
parser.add_argument(
"-d",
"--destination",
default="output",
metavar="<folder>",
help="folder to save data",
)
parser.add_argument(
"-v",
"--verbose",
default="",
metavar="<folder>",
help="category to debug",
choices=[
"",
"lines",
"odt",
"spaceout",
"whitespace",
"punctuation",
"merge",
"speakers",
"comments",
"split",
],
)
args = parser.parse_args()
return args
def main():
"Main loop"
args = parse_options()
converter = Converter(args)
for filename in args.filename:
converter.convert(filename)
if __name__ == "__main__":
main()