-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvert.py
40 lines (29 loc) · 921 Bytes
/
convert.py
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
import sys
import argparse
from utils import initialize_logger
from text_conversion.initialize import initialize_all
from text_conversion.utils import text_conversion
information = ' '.join(sys.argv)
def main(*args, **kwargs):
parser = argparse.ArgumentParser()
parser.add_argument(
'-sdp', '--source_directory_path'
, help='The path of source file'
, required=True
)
parser.add_argument(
'-ddp', '--destination_directory_path'
, help='The path of destination directory'
, required=True
)
parser.add_argument(
'-c', '--config'
, help='The config of OpenCC'
)
args = parser.parse_args()
logger = initialize_logger(log_name='text_conversion.log')
logger.info(f'\n\n\n\n{information}')
parameters = initialize_all(args=args)
text_conversion(parameters=parameters)
if __name__ == '__main__':
main()