Redmine #1835: made input structure specification xml into parameter
This commit is contained in:
@@ -10,25 +10,27 @@ if (__name__ == '__main__'):
|
||||
arg_parser.add_argument('-mode', type=str, help='Mode')
|
||||
arg_parser.add_argument('-infile', type=str, help='Input file')
|
||||
arg_parser.add_argument('-outfile', type=str, help='Output file')
|
||||
arg_parser.add_argument('-structures', type=str, help='Updated structure file')
|
||||
arg_parser.add_argument('-instructs', type=str, help='Input structure file')
|
||||
arg_parser.add_argument('-outstructs', type=str, help='Output structure file')
|
||||
arguments = arg_parser.parse_args()
|
||||
|
||||
mode = arguments.mode
|
||||
input_file_name = arguments.infile
|
||||
output_file_name = arguments.outfile
|
||||
structure_file_name = arguments.structures
|
||||
input_structure_file_name = arguments.instructs
|
||||
output_structure_file_name = arguments.outstructs
|
||||
|
||||
nlp_needed = mode in {'strings_to_parse', 'strings_to_dictionary', 'all'}
|
||||
runner = Runner(resource_directory, nlp_needed)
|
||||
if (mode == 'strings_to_parse'):
|
||||
runner.strings_to_parse(input_file_name, output_file_name)
|
||||
elif (mode == 'strings_to_dictionary'):
|
||||
runner.strings_to_dictionary(input_file_name, output_file_name, structure_file_name)
|
||||
runner.strings_to_dictionary(input_file_name, output_file_name, input_structure_file_name, output_structure_file_name)
|
||||
elif (mode == 'parse_to_dictionary'):
|
||||
runner.parse_to_dictionary(input_file_name, output_file_name, structure_file_name)
|
||||
runner.parse_to_dictionary(input_file_name, output_file_name, input_structure_file_name, output_structure_file_name)
|
||||
elif (mode == 'validate_structures'):
|
||||
runner.validate_structures(input_file_name)
|
||||
elif (mode == 'validate_dictionary'):
|
||||
runner.validate_dictionary(input_file_name)
|
||||
elif (mode == 'all'):
|
||||
runner.run_all(input_file_name, output_file_name, structure_file_name)
|
||||
runner.run_all(input_file_name, output_file_name, input_structure_file_name, output_structure_file_name)
|
||||
|
||||
@@ -11,7 +11,6 @@ git clone git@gitea.cjvt.si:redmine_projects/nova_slovnica.git
|
||||
git clone git@gitea.cjvt.si:ozbolt/luscenje_struktur.git
|
||||
git clone git@gitea.cjvt.si:generic/data_admin.git
|
||||
git clone git@gitea.cjvt.si:generic/xml_schemas.git
|
||||
scp -P 3022 proc1.cjvt.si:/net/nas/resources/miscellaneous/structures/structures.xml .
|
||||
cd ..
|
||||
|
||||
## prepare python environment
|
||||
@@ -35,5 +34,4 @@ ln -s ../lib/nova_slovnica/resources/dict.xml .
|
||||
ln -s ../lib/data_admin/resources/structures.xsd .
|
||||
ln -s ../lib/xml_schemas/resources/schema/inventory.xsd .
|
||||
ln -s ../lib/xml_schemas/resources/schema/monolingual_dictionaries.xsd .
|
||||
mv ../lib/structures.xml .
|
||||
cd ..
|
||||
|
||||
Reference in New Issue
Block a user