Skip to content

Commit

Permalink
regenerated for FoLiA v2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Sep 2, 2020
1 parent aa354d5 commit 39719de
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
homepage = "https://proycon.github.io/folia"
Expand Down
8 changes: 4 additions & 4 deletions src/specification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down Expand Up @@ -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 ];
Expand Down Expand Up @@ -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 ];
Expand Down Expand Up @@ -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 ];
Expand Down
30 changes: 15 additions & 15 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,22 @@ impl AnnotationType {
///Maps annotation types to their layer elements
pub fn layertype(&self) -> Option<ElementType> {
//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!
Expand Down

0 comments on commit 39719de

Please sign in to comment.