mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nlp.git
synced 2024-12-25 18:44:17 +00:00
Mark required arguments in scripts as required
This commit is contained in:
parent
a2e8e72e54
commit
6f0545e48b
@ -23,7 +23,8 @@ parser = ArgumentParser(
|
|||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-i', '--input-file',
|
'-i', '--input-file',
|
||||||
help='Input file'
|
help='Input file',
|
||||||
|
required=True
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-o', '--output-file',
|
'-o', '--output-file',
|
||||||
|
@ -6,16 +6,19 @@ from stand_off_data import StandOffData
|
|||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
parser = ArgumentParser(
|
parser = ArgumentParser(
|
||||||
description='Convert plain text and JSON stand off to a CWB vrt file'
|
description='Convert plain text and JSON stand off to a CWB vrt file'
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-s', '--stand-off-data-file',
|
'-s', '--stand-off-data-file',
|
||||||
help='JSON stand off data input file'
|
help='JSON stand off data input file',
|
||||||
|
required=True
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-t', '--text-file',
|
'-t', '--text-file',
|
||||||
help='Plain text input file'
|
help='Plain text input file',
|
||||||
|
required=True
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-o', '--output-file',
|
'-o', '--output-file',
|
||||||
@ -24,6 +27,7 @@ parser.add_argument(
|
|||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
with open(args.stand_off_data_file) as stand_of_data_file:
|
with open(args.stand_off_data_file) as stand_of_data_file:
|
||||||
stand_off_data = StandOffData(json.load(stand_of_data_file))
|
stand_off_data = StandOffData(json.load(stand_of_data_file))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user