From fd72e1c32d0f6798b258559cfcdbc354786c2efa Mon Sep 17 00:00:00 2001 From: Cyprian Laskowski Date: Thu, 27 Feb 2020 10:27:45 +0100 Subject: [PATCH 1/3] IssueID #1098: added schema support and example for MWE datasets --- examples/mwe_lexicon/mwe1.xml | 3 - examples/mwe_lexicon/mwe_manual_example.xml | 156 ++++++++++++++++++++ resources/schema/inventory.xsd | 8 + resources/schema/mwe_lexicon.xsd | 50 ++++++- 4 files changed, 213 insertions(+), 4 deletions(-) delete mode 100644 examples/mwe_lexicon/mwe1.xml create mode 100644 examples/mwe_lexicon/mwe_manual_example.xml diff --git a/examples/mwe_lexicon/mwe1.xml b/examples/mwe_lexicon/mwe1.xml deleted file mode 100644 index 7cb7f64..0000000 --- a/examples/mwe_lexicon/mwe1.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/examples/mwe_lexicon/mwe_manual_example.xml b/examples/mwe_lexicon/mwe_manual_example.xml new file mode 100644 index 0000000..742b409 --- /dev/null +++ b/examples/mwe_lexicon/mwe_manual_example.xml @@ -0,0 +1,156 @@ + + + + + kdo ni po kisli juhi priplaval + + + + kdo + + + ni + + + po + + + kisli + + + juhi + + + priplaval + + + + 1 + + + + kdo ni po kisli župi priplaval + + + + + + + + + + Župani + so kljub volitvam povečini na vodilna občinska mesta + priplavali + po + kisli + juhi ali župi, kot jo nezmotljivo nemčimo na + štajerskem območju. + + + + + + + + + + kdo ni po kisli župi priplaval + + + + kdo + + + ni + + + po + + + kisli + + + župi + + + priplaval + + + + 1 + + + + kdo ni po kisli juhi priplaval + + + + + + + + + + Župani + so kljub volitvam povečini na vodilna občinska mesta + priplavali + po + kisli juhi ali + župi, kot + jo nezmotljivo nemčimo na štajerskem območju. + + + + + + + + + + kdo ni po juhi priplaval + + + + + kdo + + + ni + + + po + + + juhi + + + priplaval + + + + 24 + + + + + + + + + + + Tip tudi + ni + priplaval + po + juhi in bo hitro razumel, kaj vam gre po + glavi. + + + + + + + + diff --git a/resources/schema/inventory.xsd b/resources/schema/inventory.xsd index 9c7fc46..9cc84a5 100644 --- a/resources/schema/inventory.xsd +++ b/resources/schema/inventory.xsd @@ -60,8 +60,12 @@ + + + + @@ -75,6 +79,8 @@ + + @@ -135,6 +141,7 @@ + @@ -230,6 +237,7 @@ + diff --git a/resources/schema/mwe_lexicon.xsd b/resources/schema/mwe_lexicon.xsd index 8571b8a..4d7eb35 100644 --- a/resources/schema/mwe_lexicon.xsd +++ b/resources/schema/mwe_lexicon.xsd @@ -5,6 +5,54 @@ schemaLocation="http://www.w3.org/2001/xml.xsd" /> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5a1b6e20bfe4cc26c25d335bea9d22bb69969d28 Mon Sep 17 00:00:00 2001 From: Cyprian Laskowski Date: Thu, 27 Feb 2020 10:34:37 +0100 Subject: [PATCH 2/3] IssueID #1098: renamed files to reflect conceptual refactoring --- .../mononlingual_manual_example.xml} | 0 .../schema/{mwe_lexicon.xsd => monolingual_dictionaries.xsd} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename examples/{mwe_lexicon/mwe_manual_example.xml => monolingual_dictionaries/mononlingual_manual_example.xml} (100%) rename resources/schema/{mwe_lexicon.xsd => monolingual_dictionaries.xsd} (100%) diff --git a/examples/mwe_lexicon/mwe_manual_example.xml b/examples/monolingual_dictionaries/mononlingual_manual_example.xml similarity index 100% rename from examples/mwe_lexicon/mwe_manual_example.xml rename to examples/monolingual_dictionaries/mononlingual_manual_example.xml diff --git a/resources/schema/mwe_lexicon.xsd b/resources/schema/monolingual_dictionaries.xsd similarity index 100% rename from resources/schema/mwe_lexicon.xsd rename to resources/schema/monolingual_dictionaries.xsd From 1aad5017ed99b523dc74912d948a5658dbaaf6ba Mon Sep 17 00:00:00 2001 From: Cyprian Laskowski Date: Thu, 27 Feb 2020 11:10:09 +0100 Subject: [PATCH 3/3] IssueID #1134: added basic top-down schema for dictionary datasets --- resources/schema/top_dictionaries.xsd | 24 ++++++++++++++++++++++++ scripts/validate_examples | 11 +++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 resources/schema/top_dictionaries.xsd diff --git a/resources/schema/top_dictionaries.xsd b/resources/schema/top_dictionaries.xsd new file mode 100644 index 0000000..9ea7428 --- /dev/null +++ b/resources/schema/top_dictionaries.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/validate_examples b/scripts/validate_examples index d3870b3..4f7b71c 100755 --- a/scripts/validate_examples +++ b/scripts/validate_examples @@ -4,14 +4,21 @@ script_dir="$(dirname "$(readlink -f "$0")")" cd $script_dir schema_dir=../resources/schema +top_schema=$schema_dir/top_dictionaries.xsd # for now we only have dictionaries + example_dir=../examples for example_subdir in $example_dir/* do base=${example_subdir##*/} - schema=$schema_dir/$base.xsd + bottom_schema=$schema_dir/$base.xsd for example_file in $example_subdir/*.xml do - command="xmllint -schema $schema $example_file --noout" + command="xmllint -schema $top_schema $example_file --noout" + echo $command + if ! $command; then + exit 1 + fi + command="xmllint -schema $bottom_schema $example_file --noout" echo $command if ! $command; then exit 1