2020-01-22 21:41:20 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
script_dir="$(dirname "$(readlink -f "$0")")"
|
|
|
|
cd $script_dir
|
2020-02-21 19:44:39 +00:00
|
|
|
|
|
|
|
schema_dir=../resources/schema
|
2022-01-19 13:38:41 +00:00
|
|
|
top_schema=$schema_dir/top_dictionaries.xsd
|
|
|
|
dictionary_types=("bilingual_dictionaries collocation_dictionary monolingual_dictionaries morphological_lexicon valency_lexicon")
|
2020-02-27 10:10:09 +00:00
|
|
|
|
2020-02-21 19:44:39 +00:00
|
|
|
example_dir=../examples
|
|
|
|
for example_subdir in $example_dir/*
|
|
|
|
do
|
|
|
|
base=${example_subdir##*/}
|
2020-02-27 10:10:09 +00:00
|
|
|
bottom_schema=$schema_dir/$base.xsd
|
2020-02-21 19:44:39 +00:00
|
|
|
for example_file in $example_subdir/*.xml
|
2020-01-22 21:41:20 +00:00
|
|
|
do
|
2022-01-19 13:38:41 +00:00
|
|
|
case $base in bilingual_dictionaries|collocation_dictionary|monolingual_dictionaries|morphological_lexicon|valency_lexicon)
|
|
|
|
command="xmllint -schema $top_schema $example_file --noout"
|
|
|
|
echo $command
|
|
|
|
if ! $command; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
esac
|
2020-02-27 10:10:09 +00:00
|
|
|
command="xmllint -schema $bottom_schema $example_file --noout"
|
2020-02-21 19:44:39 +00:00
|
|
|
echo $command
|
|
|
|
if ! $command; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-01-22 21:41:20 +00:00
|
|
|
done
|
2020-02-21 19:44:39 +00:00
|
|
|
done
|