From 39719de8e77fd3a2dcf21fb657ed4c5ddc2561a1 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Wed, 2 Sep 2020 16:09:51 +0200 Subject: [PATCH] regenerated for FoLiA v2.3 --- Cargo.toml | 2 +- src/specification.rs | 8 ++++---- src/types.rs | 30 +++++++++++++++--------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f1e972c..332599e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "folia" -version = "0.0.3" +version = "0.0.4" description = "High-performance library for handling the FoLiA XML format (Format for Linguistic Annotation)" authors = ["Maarten van Gompel "] homepage = "https://proycon.github.io/folia" diff --git a/src/specification.rs b/src/specification.rs index a9ac8dd..5878f92 100644 --- a/src/specification.rs +++ b/src/specification.rs @@ -615,7 +615,7 @@ impl Properties { let mut properties = Properties::default(); properties.xmltag = "div"; properties.annotationtype = Some(AnnotationType::DIVISION); - properties.accepted_data = &[AcceptedData::AcceptElementGroup(ElementGroup::Layer), AcceptedData::AcceptElementGroup(ElementGroup::Inline), AcceptedData::AcceptElementType(ElementType::Alternative), AcceptedData::AcceptElementType(ElementType::AlternativeLayers), AcceptedData::AcceptElementType(ElementType::Comment), AcceptedData::AcceptElementType(ElementType::Correction), AcceptedData::AcceptElementType(ElementType::Description), AcceptedData::AcceptElementType(ElementType::Division), AcceptedData::AcceptElementType(ElementType::Entry), AcceptedData::AcceptElementType(ElementType::Event), AcceptedData::AcceptElementType(ElementType::Example), AcceptedData::AcceptElementType(ElementType::Feature), AcceptedData::AcceptElementType(ElementType::Figure), AcceptedData::AcceptElementType(ElementType::ForeignData), AcceptedData::AcceptElementType(ElementType::Gap), AcceptedData::AcceptElementType(ElementType::Head), AcceptedData::AcceptElementType(ElementType::Linebreak), AcceptedData::AcceptElementType(ElementType::List), AcceptedData::AcceptElementType(ElementType::Metric), AcceptedData::AcceptElementType(ElementType::Note), AcceptedData::AcceptElementType(ElementType::Paragraph), AcceptedData::AcceptElementType(ElementType::Part), AcceptedData::AcceptElementType(ElementType::PhonContent), AcceptedData::AcceptElementType(ElementType::Quote), AcceptedData::AcceptElementType(ElementType::Reference), AcceptedData::AcceptElementType(ElementType::Relation), AcceptedData::AcceptElementType(ElementType::Sentence), AcceptedData::AcceptElementType(ElementType::Table), AcceptedData::AcceptElementType(ElementType::TextContent), AcceptedData::AcceptElementType(ElementType::Utterance), AcceptedData::AcceptElementType(ElementType::Whitespace)]; + properties.accepted_data = &[AcceptedData::AcceptElementGroup(ElementGroup::Layer), AcceptedData::AcceptElementGroup(ElementGroup::Inline), AcceptedData::AcceptElementType(ElementType::Alternative), AcceptedData::AcceptElementType(ElementType::AlternativeLayers), AcceptedData::AcceptElementType(ElementType::Comment), AcceptedData::AcceptElementType(ElementType::Correction), AcceptedData::AcceptElementType(ElementType::Description), AcceptedData::AcceptElementType(ElementType::Division), AcceptedData::AcceptElementType(ElementType::Entry), AcceptedData::AcceptElementType(ElementType::Event), AcceptedData::AcceptElementType(ElementType::Example), AcceptedData::AcceptElementType(ElementType::Feature), AcceptedData::AcceptElementType(ElementType::Figure), AcceptedData::AcceptElementType(ElementType::ForeignData), AcceptedData::AcceptElementType(ElementType::Gap), AcceptedData::AcceptElementType(ElementType::Head), AcceptedData::AcceptElementType(ElementType::Linebreak), AcceptedData::AcceptElementType(ElementType::List), AcceptedData::AcceptElementType(ElementType::Metric), AcceptedData::AcceptElementType(ElementType::Note), AcceptedData::AcceptElementType(ElementType::Paragraph), AcceptedData::AcceptElementType(ElementType::Part), AcceptedData::AcceptElementType(ElementType::PhonContent), AcceptedData::AcceptElementType(ElementType::Quote), AcceptedData::AcceptElementType(ElementType::Reference), AcceptedData::AcceptElementType(ElementType::Relation), AcceptedData::AcceptElementType(ElementType::Sentence), AcceptedData::AcceptElementType(ElementType::Table), AcceptedData::AcceptElementType(ElementType::TextContent), AcceptedData::AcceptElementType(ElementType::Utterance), AcceptedData::AcceptElementType(ElementType::Whitespace), AcceptedData::AcceptElementType(ElementType::Word)]; properties.required_data = &[]; properties.required_attribs = &[]; properties.optional_attribs = &[ AttribType::ANNOTATOR,AttribType::BEGINTIME,AttribType::CLASS,AttribType::CONFIDENCE,AttribType::DATETIME,AttribType::ENDTIME,AttribType::ID,AttribType::METADATA,AttribType::N,AttribType::SPACE,AttribType::SPEAKER,AttribType::SRC ]; @@ -900,7 +900,7 @@ impl Properties { let mut properties = Properties::default(); properties.xmltag = "figure"; properties.annotationtype = Some(AnnotationType::FIGURE); - properties.accepted_data = &[AcceptedData::AcceptElementGroup(ElementGroup::Layer), AcceptedData::AcceptElementType(ElementType::Alternative), AcceptedData::AcceptElementType(ElementType::AlternativeLayers), AcceptedData::AcceptElementType(ElementType::Caption), AcceptedData::AcceptElementType(ElementType::Comment), AcceptedData::AcceptElementType(ElementType::Correction), AcceptedData::AcceptElementType(ElementType::Description), AcceptedData::AcceptElementType(ElementType::Feature), AcceptedData::AcceptElementType(ElementType::ForeignData), AcceptedData::AcceptElementType(ElementType::Metric), AcceptedData::AcceptElementType(ElementType::Part), AcceptedData::AcceptElementType(ElementType::Relation), AcceptedData::AcceptElementType(ElementType::String), AcceptedData::AcceptElementType(ElementType::TextContent)]; + properties.accepted_data = &[AcceptedData::AcceptElementGroup(ElementGroup::Layer), AcceptedData::AcceptElementType(ElementType::Alternative), AcceptedData::AcceptElementType(ElementType::AlternativeLayers), AcceptedData::AcceptElementType(ElementType::Caption), AcceptedData::AcceptElementType(ElementType::Comment), AcceptedData::AcceptElementType(ElementType::Correction), AcceptedData::AcceptElementType(ElementType::Description), AcceptedData::AcceptElementType(ElementType::Feature), AcceptedData::AcceptElementType(ElementType::ForeignData), AcceptedData::AcceptElementType(ElementType::Linebreak), AcceptedData::AcceptElementType(ElementType::Metric), AcceptedData::AcceptElementType(ElementType::Part), AcceptedData::AcceptElementType(ElementType::Relation), AcceptedData::AcceptElementType(ElementType::String), AcceptedData::AcceptElementType(ElementType::TextContent)]; properties.required_data = &[]; properties.required_attribs = &[]; properties.optional_attribs = &[ AttribType::ANNOTATOR,AttribType::BEGINTIME,AttribType::CLASS,AttribType::CONFIDENCE,AttribType::DATETIME,AttribType::ENDTIME,AttribType::ID,AttribType::METADATA,AttribType::N,AttribType::SPACE,AttribType::SPEAKER,AttribType::SRC ]; @@ -1288,7 +1288,7 @@ impl Properties { let mut properties = Properties::default(); properties.xmltag = "list"; properties.annotationtype = Some(AnnotationType::LIST); - properties.accepted_data = &[AcceptedData::AcceptElementGroup(ElementGroup::Layer), AcceptedData::AcceptElementGroup(ElementGroup::Inline), AcceptedData::AcceptElementType(ElementType::Alternative), AcceptedData::AcceptElementType(ElementType::AlternativeLayers), AcceptedData::AcceptElementType(ElementType::Caption), AcceptedData::AcceptElementType(ElementType::Comment), AcceptedData::AcceptElementType(ElementType::Correction), AcceptedData::AcceptElementType(ElementType::Description), AcceptedData::AcceptElementType(ElementType::Event), AcceptedData::AcceptElementType(ElementType::Feature), AcceptedData::AcceptElementType(ElementType::ForeignData), AcceptedData::AcceptElementType(ElementType::ListItem), AcceptedData::AcceptElementType(ElementType::Metric), AcceptedData::AcceptElementType(ElementType::Note), AcceptedData::AcceptElementType(ElementType::Part), AcceptedData::AcceptElementType(ElementType::PhonContent), AcceptedData::AcceptElementType(ElementType::Reference), AcceptedData::AcceptElementType(ElementType::Relation), AcceptedData::AcceptElementType(ElementType::String), AcceptedData::AcceptElementType(ElementType::TextContent)]; + properties.accepted_data = &[AcceptedData::AcceptElementGroup(ElementGroup::Layer), AcceptedData::AcceptElementGroup(ElementGroup::Inline), AcceptedData::AcceptElementType(ElementType::Alternative), AcceptedData::AcceptElementType(ElementType::AlternativeLayers), AcceptedData::AcceptElementType(ElementType::Caption), AcceptedData::AcceptElementType(ElementType::Comment), AcceptedData::AcceptElementType(ElementType::Correction), AcceptedData::AcceptElementType(ElementType::Description), AcceptedData::AcceptElementType(ElementType::Event), AcceptedData::AcceptElementType(ElementType::Feature), AcceptedData::AcceptElementType(ElementType::ForeignData), AcceptedData::AcceptElementType(ElementType::Linebreak), AcceptedData::AcceptElementType(ElementType::ListItem), AcceptedData::AcceptElementType(ElementType::Metric), AcceptedData::AcceptElementType(ElementType::Note), AcceptedData::AcceptElementType(ElementType::Part), AcceptedData::AcceptElementType(ElementType::PhonContent), AcceptedData::AcceptElementType(ElementType::Reference), AcceptedData::AcceptElementType(ElementType::Relation), AcceptedData::AcceptElementType(ElementType::String), AcceptedData::AcceptElementType(ElementType::TextContent)]; properties.required_data = &[]; properties.required_attribs = &[]; properties.optional_attribs = &[ AttribType::ANNOTATOR,AttribType::BEGINTIME,AttribType::CLASS,AttribType::CONFIDENCE,AttribType::DATETIME,AttribType::ENDTIME,AttribType::ID,AttribType::METADATA,AttribType::N,AttribType::SPACE,AttribType::SPEAKER,AttribType::SRC ]; @@ -2421,7 +2421,7 @@ impl Properties { let mut properties = Properties::default(); properties.xmltag = "table"; properties.annotationtype = Some(AnnotationType::TABLE); - properties.accepted_data = &[AcceptedData::AcceptElementGroup(ElementGroup::Layer), AcceptedData::AcceptElementGroup(ElementGroup::Inline), AcceptedData::AcceptElementType(ElementType::Alternative), AcceptedData::AcceptElementType(ElementType::AlternativeLayers), AcceptedData::AcceptElementType(ElementType::Comment), AcceptedData::AcceptElementType(ElementType::Correction), AcceptedData::AcceptElementType(ElementType::Description), AcceptedData::AcceptElementType(ElementType::Feature), AcceptedData::AcceptElementType(ElementType::ForeignData), AcceptedData::AcceptElementType(ElementType::Metric), AcceptedData::AcceptElementType(ElementType::Part), AcceptedData::AcceptElementType(ElementType::Relation), AcceptedData::AcceptElementType(ElementType::Row), AcceptedData::AcceptElementType(ElementType::TableHead)]; + properties.accepted_data = &[AcceptedData::AcceptElementGroup(ElementGroup::Layer), AcceptedData::AcceptElementGroup(ElementGroup::Inline), AcceptedData::AcceptElementType(ElementType::Alternative), AcceptedData::AcceptElementType(ElementType::AlternativeLayers), AcceptedData::AcceptElementType(ElementType::Comment), AcceptedData::AcceptElementType(ElementType::Correction), AcceptedData::AcceptElementType(ElementType::Description), AcceptedData::AcceptElementType(ElementType::Feature), AcceptedData::AcceptElementType(ElementType::ForeignData), AcceptedData::AcceptElementType(ElementType::Linebreak), AcceptedData::AcceptElementType(ElementType::Metric), AcceptedData::AcceptElementType(ElementType::Part), AcceptedData::AcceptElementType(ElementType::Relation), AcceptedData::AcceptElementType(ElementType::Row), AcceptedData::AcceptElementType(ElementType::TableHead)]; properties.required_data = &[]; properties.required_attribs = &[]; properties.optional_attribs = &[ AttribType::ANNOTATOR,AttribType::BEGINTIME,AttribType::CLASS,AttribType::CONFIDENCE,AttribType::DATETIME,AttribType::ENDTIME,AttribType::ID,AttribType::METADATA,AttribType::N,AttribType::SPACE,AttribType::SPEAKER,AttribType::SRC ]; diff --git a/src/types.rs b/src/types.rs index b615674..d403dc4 100644 --- a/src/types.rs +++ b/src/types.rs @@ -262,22 +262,22 @@ impl AnnotationType { ///Maps annotation types to their layer elements pub fn layertype(&self) -> Option { //foliaspec:annotationtype_layerclass_map(self) - //A mapping from annotation types to strings match self { - AnnotationType::CHUNKING => Some(ElementType::ChunkingLayer), - AnnotationType::COREFERENCE => Some(ElementType::CoreferenceLayer), - AnnotationType::DEPENDENCY => Some(ElementType::DependenciesLayer), - AnnotationType::ENTITY => Some(ElementType::EntitiesLayer), - AnnotationType::MORPHOLOGICAL => Some(ElementType::MorphologyLayer), - AnnotationType::OBSERVATION => Some(ElementType::ObservationLayer), - AnnotationType::PREDICATE => Some(ElementType::SemanticRolesLayer), - AnnotationType::SEMROLE => Some(ElementType::SemanticRolesLayer), - AnnotationType::SENTIMENT => Some(ElementType::SentimentLayer), - AnnotationType::SPANRELATION => Some(ElementType::SpanRelationLayer), - AnnotationType::STATEMENT => Some(ElementType::StatementLayer), - AnnotationType::SYNTAX => Some(ElementType::SyntaxLayer), - AnnotationType::TIMESEGMENT => Some(ElementType::TimingLayer), - _ => None + AnnotationType::CHUNKING => Some(ElementType::ChunkingLayer), + AnnotationType::COREFERENCE => Some(ElementType::CoreferenceLayer), + AnnotationType::DEPENDENCY => Some(ElementType::DependenciesLayer), + AnnotationType::ENTITY => Some(ElementType::EntitiesLayer), + AnnotationType::MORPHOLOGICAL => Some(ElementType::MorphologyLayer), + AnnotationType::OBSERVATION => Some(ElementType::ObservationLayer), + AnnotationType::PHONOLOGICAL => Some(ElementType::PhonologyLayer), + AnnotationType::SEMROLE => Some(ElementType::SemanticRolesLayer), + AnnotationType::SENTIMENT => Some(ElementType::SentimentLayer), + AnnotationType::SPANRELATION => Some(ElementType::SpanRelationLayer), + AnnotationType::STATEMENT => Some(ElementType::StatementLayer), + AnnotationType::SYNTAX => Some(ElementType::SyntaxLayer), + AnnotationType::TIMESEGMENT => Some(ElementType::TimingLayer), + AnnotationType::PREDICATE => Some(ElementType::SemanticRolesLayer), + _ => None } //leave the above line empty for foliaspec!