-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_csl_xml.sh
executable file
·49 lines (32 loc) · 1.33 KB
/
generate_csl_xml.sh
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
#!/bin/bash
csl_ids=(acc ae ap90 ben bhs bop bor bur cae ccs gra gst ieg inm krm mci md mw mw72 mwe pe pgn pui pw pwg sch shs skd snp stc vcp vei wil yat)
# pd, ap not to be find in csl-origin
#$1 abs_path_to csl-orig (e.g. '/opt/cdsd/csl-orig/v02/')
#$2 abs_path_to csl-pywork bash files (in csl-pywork e.g. '/opt/cdsd/csl-pywork/v02/'
#$3 abs_path_to csl-pywork_output e.g. '/opt/cdsd/csl-generated-pywork/'
#$4 abs_path_to_generated_kosh_files e.g. '/opt/cdsd/csl-generated-kosh/'
#$5 abs_path to conda.sh e.g. '/home/me/miniconda3/etc/profile.d/conda.sh'
source $5
conda activate csl-kosh
for dict_id in "${csl_ids[@]}"
do
cd ${2}
echo "current dir $PWD"
# generate_orig.py
python generate.py "${dict_id}" inventory_orig.txt _ "${1}${dict_id}" ${3}${dict_id}
echo "${3}${dict_id} has been generated"
# generate_pywork.py
python generate.py "${dict_id}" inventory.txt makotemplates distinctfiles/${dict_id} ${3}${dict_id}
# go to the generated local instance
cd ${3}${dict_id}/pywork
echo "regenerate ${dict_id} headwords"
sh redo_hw.sh
echo "regenerate ${dict_id}.xml files"
sh redo_xml.sh
#mkdir if not available
mkdir -p ${4}${dict_id}
echo "${4}${dict_id} created"
# copy xml file fo csl-kosh_generated
cp ${dict_id}.xml ${4}${dict_id}/${dict_id}.xml
echo "${dict_id}.xml copied to ${4}${dict_id}"
done