From 5fcb9c6a3cb8f96c6781496970b4a9075ed90731 Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Sun, 7 Feb 2021 13:11:31 +0100 Subject: [PATCH 01/15] Add basic EncodingDesc parser Elements in encodingDesc are temporarily parsed in a generic way. --- src/app/models/evt-models.ts | 15 ++++++++++++ src/app/services/xml-parsers/header-parser.ts | 24 ++++++++++++++++++- src/app/services/xml-parsers/xml-parsers.ts | 2 ++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index a1653904c..a768371b7 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -849,3 +849,18 @@ export class SourceDesc extends GenericElement { } export class Extent extends GenericElement { } + +export class EncodingDesc extends GenericElement { + structuredData: boolean; + projectDesc: Array>; // TODO: Add specific type when projectDesc is handled + samplingDecl: Array>; // TODO: Add specific type when samplingDecl is handled + editorialDecl: Array>; // TODO: Add specific type when editorialDecl is handled + tagsDecl: Array>; // TODO: Add specific type when tagsDecl is handled + styleDefDecl: Array>; // TODO: Add specific type when styleDefDecl is handled + refsDecl: Array>; // TODO: Add specific type when refsDecl is handled + classDecl: Array>; // TODO: Add specific type when classDecl is handled + geoDecl: Array>; // TODO: Add specific type when geoDecl is handled + unitDecl: Array>; // TODO: Add specific type when unitDecl is handled + schemaSpec: Array>; // TODO: Add specific type when schemaSpec is handled + schemaRef: Array>; // TODO: Add specific type when schemaRef is handled +} diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 9246703e7..e6abadbb6 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -1,7 +1,7 @@ import { isNestedInElem } from 'src/app/utils/dom-utils'; import { xmlParser } from '.'; import { - EditionStmt, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, Note, + EditionStmt, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, Note, NotesStmt, PublicationStmt, Resp, RespStmt, SeriesStmt, SourceDesc, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; @@ -186,3 +186,25 @@ export class FileDescParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): EncodingDesc { + return { + ...super.parse(xml), + type: EncodingDesc, + structuredData: Array.from(xml.children).filter(el => el.tagName === 'p').length !== xml.children.length, + projectDesc: queryAndParseElements(xml, 'projectDesc'), + samplingDecl: queryAndParseElements(xml, 'samplingDecl'), + editorialDecl: queryAndParseElements(xml, 'editorialDecl'), + tagsDecl: queryAndParseElements(xml, 'tagsDecl'), + styleDefDecl: queryAndParseElements(xml, 'styleDefDecl'), + refsDecl: queryAndParseElements(xml, 'refsDecl'), + classDecl: queryAndParseElements(xml, 'classDecl'), + geoDecl: queryAndParseElements(xml, 'geoDecl'), + unitDecl: queryAndParseElements(xml, 'unitDecl'), + schemaSpec: queryAndParseElements(xml, 'schemaSpec'), + schemaRef: queryAndParseElements(xml, 'schemaRef'), + }; + } +} diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index 038b9e13c..a5bceda14 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -8,6 +8,7 @@ import { CharParser, GlyphParser, GParser } from './character-declarations-parse import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; +import { EncodingDescParser } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, AltIdentifierParser, BindingDescParser, BindingParser, CollationParser, CollectionParser, ConditionParser, @@ -60,6 +61,7 @@ export function ParsersDecl(declarations: Array>) { DepthParser, DimensionsParser, DimParser, + EncodingDescParser, ExplicitParser, FiliationParser, FinalRubricParser, From 62b34118177c415275115a3f74f21171d93e857d Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Sun, 7 Feb 2021 13:14:06 +0100 Subject: [PATCH 02/15] Add ProjectDesc parser --- src/app/models/evt-models.ts | 6 +++++- src/app/services/xml-parsers/header-parser.ts | 15 +++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index a768371b7..f9ec2bc88 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -852,7 +852,7 @@ export class Extent extends GenericElement { } export class EncodingDesc extends GenericElement { structuredData: boolean; - projectDesc: Array>; // TODO: Add specific type when projectDesc is handled + projectDesc: ProjectDesc[]; samplingDecl: Array>; // TODO: Add specific type when samplingDecl is handled editorialDecl: Array>; // TODO: Add specific type when editorialDecl is handled tagsDecl: Array>; // TODO: Add specific type when tagsDecl is handled @@ -864,3 +864,7 @@ export class EncodingDesc extends GenericElement { schemaSpec: Array>; // TODO: Add specific type when schemaSpec is handled schemaRef: Array>; // TODO: Add specific type when schemaRef is handled } + +export class ProjectDesc extends GenericElement { + content: Paragraph[]; +} diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index e6abadbb6..5a6a8e1ab 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -2,7 +2,7 @@ import { isNestedInElem } from 'src/app/utils/dom-utils'; import { xmlParser } from '.'; import { EditionStmt, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, Note, - NotesStmt, PublicationStmt, Resp, RespStmt, SeriesStmt, SourceDesc, TitleStmt, XMLElement, + NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Resp, RespStmt, SeriesStmt, SourceDesc, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; import { NamedEntityRefParser } from './named-entity-parsers'; @@ -187,6 +187,17 @@ export class FileDescParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): ProjectDesc { + return { + ...super.parse(xml), + type: ProjectDesc, + content: queryAndParseElements(xml, 'p'), + }; + } +} + @xmlParser('encodingDesc', EncodingDescParser) export class EncodingDescParser extends GenericParser implements Parser { parse(xml: XMLElement): EncodingDesc { @@ -194,7 +205,7 @@ export class EncodingDescParser extends GenericParser implements Parser el.tagName === 'p').length !== xml.children.length, - projectDesc: queryAndParseElements(xml, 'projectDesc'), + projectDesc: queryAndParseElements(xml, 'projectDesc'), samplingDecl: queryAndParseElements(xml, 'samplingDecl'), editorialDecl: queryAndParseElements(xml, 'editorialDecl'), tagsDecl: queryAndParseElements(xml, 'tagsDecl'), diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index a5bceda14..070139bf0 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -8,7 +8,7 @@ import { CharParser, GlyphParser, GParser } from './character-declarations-parse import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; -import { EncodingDescParser } from './header-parser'; +import { EncodingDescParser, ProjectDescParser } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, AltIdentifierParser, BindingDescParser, BindingParser, CollationParser, CollectionParser, ConditionParser, @@ -102,6 +102,7 @@ export function ParsersDecl(declarations: Array>) { PersonParser, PhysDescParser, PlaceParser, + ProjectDescParser, ProvenanceParser, PtrParser, RdgParser, From 9ef2755ec8d20d15f9ee9f6a9863d5c818858a6b Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:20:55 +0100 Subject: [PATCH 03/15] Add SamplingDecl parser --- src/app/models/evt-models.ts | 6 +++++- src/app/services/xml-parsers/header-parser.ts | 15 +++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index f9ec2bc88..a0bc89471 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -853,7 +853,7 @@ export class Extent extends GenericElement { } export class EncodingDesc extends GenericElement { structuredData: boolean; projectDesc: ProjectDesc[]; - samplingDecl: Array>; // TODO: Add specific type when samplingDecl is handled + samplingDecl: SamplingDecl[]; editorialDecl: Array>; // TODO: Add specific type when editorialDecl is handled tagsDecl: Array>; // TODO: Add specific type when tagsDecl is handled styleDefDecl: Array>; // TODO: Add specific type when styleDefDecl is handled @@ -868,3 +868,7 @@ export class EncodingDesc extends GenericElement { export class ProjectDesc extends GenericElement { content: Paragraph[]; } + +export class SamplingDecl extends GenericElement { + content: Paragraph[]; +} diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 5a6a8e1ab..5685d3a9c 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -2,7 +2,7 @@ import { isNestedInElem } from 'src/app/utils/dom-utils'; import { xmlParser } from '.'; import { EditionStmt, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, Note, - NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Resp, RespStmt, SeriesStmt, SourceDesc, TitleStmt, XMLElement, + NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Resp, RespStmt, SamplingDecl, SeriesStmt, SourceDesc, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; import { NamedEntityRefParser } from './named-entity-parsers'; @@ -198,6 +198,17 @@ export class ProjectDescParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): SamplingDecl { + return { + ...super.parse(xml), + type: SamplingDecl, + content: queryAndParseElements(xml, 'p'), + }; + } +} + @xmlParser('encodingDesc', EncodingDescParser) export class EncodingDescParser extends GenericParser implements Parser { parse(xml: XMLElement): EncodingDesc { @@ -206,7 +217,7 @@ export class EncodingDescParser extends GenericParser implements Parser el.tagName === 'p').length !== xml.children.length, projectDesc: queryAndParseElements(xml, 'projectDesc'), - samplingDecl: queryAndParseElements(xml, 'samplingDecl'), + samplingDecl: queryAndParseElements(xml, 'samplingDecl'), editorialDecl: queryAndParseElements(xml, 'editorialDecl'), tagsDecl: queryAndParseElements(xml, 'tagsDecl'), styleDefDecl: queryAndParseElements(xml, 'styleDefDecl'), diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index 070139bf0..9a1fd7820 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -8,7 +8,7 @@ import { CharParser, GlyphParser, GParser } from './character-declarations-parse import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; -import { EncodingDescParser, ProjectDescParser } from './header-parser'; +import { EncodingDescParser, ProjectDescParser, SamplingDeclParser } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, AltIdentifierParser, BindingDescParser, BindingParser, CollationParser, CollectionParser, ConditionParser, @@ -109,6 +109,7 @@ export function ParsersDecl(declarations: Array>) { RecordHistParser, RepositoryParser, RubricParser, + SamplingDeclParser, ScriptDescParser, SealDescParser, SealParser, From 19a8b14741a9a3f1fa7d7723607b9eadc2385d60 Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:22:47 +0100 Subject: [PATCH 04/15] Add EditorialDecl parser Elements in editorialDecl are temporarily parsed in a generic way. --- src/app/models/evt-models.ts | 14 ++++++++++- src/app/services/xml-parsers/header-parser.ts | 23 +++++++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 3 ++- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index a0bc89471..22fe8ba12 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -854,7 +854,7 @@ export class EncodingDesc extends GenericElement { structuredData: boolean; projectDesc: ProjectDesc[]; samplingDecl: SamplingDecl[]; - editorialDecl: Array>; // TODO: Add specific type when editorialDecl is handled + editorialDecl: EditorialDecl[]; tagsDecl: Array>; // TODO: Add specific type when tagsDecl is handled styleDefDecl: Array>; // TODO: Add specific type when styleDefDecl is handled refsDecl: Array>; // TODO: Add specific type when refsDecl is handled @@ -872,3 +872,15 @@ export class ProjectDesc extends GenericElement { export class SamplingDecl extends GenericElement { content: Paragraph[]; } + +export class EditorialDecl extends GenericElement { + structuredData: boolean; + correction: Array>; // TODO: Add specific type when correction is handled + hyphenation: Array>; // TODO: Add specific type when hyphenation is handled + interpretation: Array>; // TODO: Add specific type when interpretation is handled + normalization: Array>; // TODO: Add specific type when normalization is handled + punctuation: Array>; // TODO: Add specific type when punctuation is handled + quotation: Array>; // TODO: Add specific type when quotation is handled + segmentation: Array>; // TODO: Add specific type when segmentation is handled + stdVals: Array>; // TODO: Add specific type when stdVals is handled +} diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 5685d3a9c..4324f7ee5 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -1,7 +1,7 @@ import { isNestedInElem } from 'src/app/utils/dom-utils'; import { xmlParser } from '.'; import { - EditionStmt, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, Note, + EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, Note, NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Resp, RespStmt, SamplingDecl, SeriesStmt, SourceDesc, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; @@ -209,6 +209,25 @@ export class SamplingDeclParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): EditorialDecl { + return { + ...super.parse(xml), + type: EditorialDecl, + structuredData: Array.from(xml.children).filter(el => el.tagName === 'p').length !== xml.children.length, + correction: queryAndParseElements(xml, 'correction'), + hyphenation: queryAndParseElements(xml, 'hyphenation'), + interpretation: queryAndParseElements(xml, 'interpretation'), + normalization: queryAndParseElements(xml, 'normalization'), + punctuation: queryAndParseElements(xml, 'punctuation'), + quotation: queryAndParseElements(xml, 'quotation'), + segmentation: queryAndParseElements(xml, 'segmentation'), + stdVals: queryAndParseElements(xml, 'stdVals'), + }; + } +} + @xmlParser('encodingDesc', EncodingDescParser) export class EncodingDescParser extends GenericParser implements Parser { parse(xml: XMLElement): EncodingDesc { @@ -218,7 +237,7 @@ export class EncodingDescParser extends GenericParser implements Parser el.tagName === 'p').length !== xml.children.length, projectDesc: queryAndParseElements(xml, 'projectDesc'), samplingDecl: queryAndParseElements(xml, 'samplingDecl'), - editorialDecl: queryAndParseElements(xml, 'editorialDecl'), + editorialDecl: queryAndParseElements(xml, 'editorialDecl'), tagsDecl: queryAndParseElements(xml, 'tagsDecl'), styleDefDecl: queryAndParseElements(xml, 'styleDefDecl'), refsDecl: queryAndParseElements(xml, 'refsDecl'), diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index 9a1fd7820..e15735b93 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -8,7 +8,7 @@ import { CharParser, GlyphParser, GParser } from './character-declarations-parse import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; -import { EncodingDescParser, ProjectDescParser, SamplingDeclParser } from './header-parser'; +import { EditorialDeclParser, EncodingDescParser, ProjectDescParser, SamplingDeclParser } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, AltIdentifierParser, BindingDescParser, BindingParser, CollationParser, CollectionParser, ConditionParser, @@ -61,6 +61,7 @@ export function ParsersDecl(declarations: Array>) { DepthParser, DimensionsParser, DimParser, + EditorialDeclParser, EncodingDescParser, ExplicitParser, FiliationParser, From 110d4872ac76818ff29039fc7757b17f32c31e0e Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:24:56 +0100 Subject: [PATCH 05/15] Add Correction parser --- src/app/models/evt-models.ts | 10 +++++++++- src/app/services/xml-parsers/header-parser.ts | 16 +++++++++++++++- src/app/services/xml-parsers/xml-parsers.ts | 3 ++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index 22fe8ba12..86009513a 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -873,9 +873,17 @@ export class SamplingDecl extends GenericElement { content: Paragraph[]; } +export type CorrectionStatus = 'high' | 'medium' | 'low' | 'unknown'; +export type CorrectionMethod = 'silent' | 'markup'; +export class Correction extends GenericElement { + content: Paragraph[]; + status?: CorrectionStatus; + method?: CorrectionMethod; +} + export class EditorialDecl extends GenericElement { structuredData: boolean; - correction: Array>; // TODO: Add specific type when correction is handled + correction: Correction[]; hyphenation: Array>; // TODO: Add specific type when hyphenation is handled interpretation: Array>; // TODO: Add specific type when interpretation is handled normalization: Array>; // TODO: Add specific type when normalization is handled diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 4324f7ee5..37b50de20 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -1,6 +1,7 @@ import { isNestedInElem } from 'src/app/utils/dom-utils'; import { xmlParser } from '.'; import { + Correction, CorrectionMethod, CorrectionStatus, EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, Note, NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Resp, RespStmt, SamplingDecl, SeriesStmt, SourceDesc, TitleStmt, XMLElement, } from '../../models/evt-models'; @@ -209,6 +210,19 @@ export class SamplingDeclParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): Correction { + return { + ...super.parse(xml), + type: Correction, + content: queryAndParseElements(xml, 'p'), + status: xml.getAttribute('status') as CorrectionStatus, + method: xml.getAttribute('method') as CorrectionMethod || 'silent', + }; + } +} + @xmlParser('editorialDecl', EditorialDeclParser) export class EditorialDeclParser extends GenericParser implements Parser { parse(xml: XMLElement): EditorialDecl { @@ -216,7 +230,7 @@ export class EditorialDeclParser extends GenericParser implements Parser el.tagName === 'p').length !== xml.children.length, - correction: queryAndParseElements(xml, 'correction'), + correction: queryAndParseElements(xml, 'correction'), hyphenation: queryAndParseElements(xml, 'hyphenation'), interpretation: queryAndParseElements(xml, 'interpretation'), normalization: queryAndParseElements(xml, 'normalization'), diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index e15735b93..06b12cf3b 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -8,7 +8,7 @@ import { CharParser, GlyphParser, GParser } from './character-declarations-parse import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; -import { EditorialDeclParser, EncodingDescParser, ProjectDescParser, SamplingDeclParser } from './header-parser'; +import { CorrectionParser, EditorialDeclParser, EncodingDescParser, ProjectDescParser, SamplingDeclParser } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, AltIdentifierParser, BindingDescParser, BindingParser, CollationParser, CollectionParser, ConditionParser, @@ -52,6 +52,7 @@ export function ParsersDecl(declarations: Array>) { CollationParser, CollectionParser, ConditionParser, + CorrectionParser, CustEventParser, CustodialHistParser, DamageParser, From fa18b885db8ebd3f950330dbc0bd00b9538cac2b Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:26:40 +0100 Subject: [PATCH 06/15] Add Normalization parser --- src/app/models/evt-models.ts | 9 ++++++++- src/app/services/xml-parsers/header-parser.ts | 18 ++++++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 3 ++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index 86009513a..ec0f84ada 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -881,12 +881,19 @@ export class Correction extends GenericElement { method?: CorrectionMethod; } +export type NormalizationMethod = 'silent' | 'markup'; +export class Normalization extends GenericElement { + content: Paragraph[]; + method: NormalizationMethod; + sources: string[]; +} + export class EditorialDecl extends GenericElement { structuredData: boolean; correction: Correction[]; hyphenation: Array>; // TODO: Add specific type when hyphenation is handled interpretation: Array>; // TODO: Add specific type when interpretation is handled - normalization: Array>; // TODO: Add specific type when normalization is handled + normalization: Normalization[]; punctuation: Array>; // TODO: Add specific type when punctuation is handled quotation: Array>; // TODO: Add specific type when quotation is handled segmentation: Array>; // TODO: Add specific type when segmentation is handled diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 37b50de20..4930a879d 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -2,7 +2,8 @@ import { isNestedInElem } from 'src/app/utils/dom-utils'; import { xmlParser } from '.'; import { Correction, CorrectionMethod, CorrectionStatus, - EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, Note, + EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, + Normalization, NormalizationMethod, Note, NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Resp, RespStmt, SamplingDecl, SeriesStmt, SourceDesc, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; @@ -223,6 +224,19 @@ export class CorrectionParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): Normalization { + return { + ...super.parse(xml), + type: Normalization, + content: queryAndParseElements(xml, 'p'), + sources: xml.getAttribute('source')?.split(' ') || [], + method: xml.getAttribute('method') as NormalizationMethod || 'silent', + }; + } +} + @xmlParser('editorialDecl', EditorialDeclParser) export class EditorialDeclParser extends GenericParser implements Parser { parse(xml: XMLElement): EditorialDecl { @@ -233,7 +247,7 @@ export class EditorialDeclParser extends GenericParser implements Parser(xml, 'correction'), hyphenation: queryAndParseElements(xml, 'hyphenation'), interpretation: queryAndParseElements(xml, 'interpretation'), - normalization: queryAndParseElements(xml, 'normalization'), + normalization: queryAndParseElements(xml, 'normalization'), punctuation: queryAndParseElements(xml, 'punctuation'), quotation: queryAndParseElements(xml, 'quotation'), segmentation: queryAndParseElements(xml, 'segmentation'), diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index 06b12cf3b..304f4b750 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -8,7 +8,7 @@ import { CharParser, GlyphParser, GParser } from './character-declarations-parse import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; -import { CorrectionParser, EditorialDeclParser, EncodingDescParser, ProjectDescParser, SamplingDeclParser } from './header-parser'; +import { CorrectionParser, EditorialDeclParser, EncodingDescParser, NormalizationParser, ProjectDescParser, SamplingDeclParser } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, AltIdentifierParser, BindingDescParser, BindingParser, CollationParser, CollectionParser, ConditionParser, @@ -93,6 +93,7 @@ export function ParsersDecl(declarations: Array>) { MsPartParser, MusicNotationParser, NamedEntityRefParser, + NormalizationParser, NoteParser, ObjectDescParser, OrganizationParser, From 55002137d40d2340bc582aac0556d3cf05a4f6e6 Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:28:09 +0100 Subject: [PATCH 07/15] Add Punctuation parser --- src/app/models/evt-models.ts | 10 +++++++++- src/app/services/xml-parsers/header-parser.ts | 18 ++++++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 3 ++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index ec0f84ada..8a8358772 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -888,13 +888,21 @@ export class Normalization extends GenericElement { sources: string[]; } +export type PunctuationMarks = 'none' | 'some' | 'all'; +export type PunctuationPlacement = 'internal' | 'external'; +export class Punctuation extends GenericElement { + content: Paragraph[]; + marks?: PunctuationMarks; + placement?: PunctuationPlacement; +} + export class EditorialDecl extends GenericElement { structuredData: boolean; correction: Correction[]; hyphenation: Array>; // TODO: Add specific type when hyphenation is handled interpretation: Array>; // TODO: Add specific type when interpretation is handled normalization: Normalization[]; - punctuation: Array>; // TODO: Add specific type when punctuation is handled + punctuation: Punctuation[]; quotation: Array>; // TODO: Add specific type when quotation is handled segmentation: Array>; // TODO: Add specific type when segmentation is handled stdVals: Array>; // TODO: Add specific type when stdVals is handled diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 4930a879d..67445194f 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -4,7 +4,8 @@ import { Correction, CorrectionMethod, CorrectionStatus, EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, Normalization, NormalizationMethod, Note, - NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Resp, RespStmt, SamplingDecl, SeriesStmt, SourceDesc, TitleStmt, XMLElement, + NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Punctuation, PunctuationMarks, PunctuationPlacement, + Resp, RespStmt, SamplingDecl, SeriesStmt, SourceDesc, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; import { NamedEntityRefParser } from './named-entity-parsers'; @@ -237,6 +238,19 @@ export class NormalizationParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): Punctuation { + return { + ...super.parse(xml), + type: Punctuation, + content: queryAndParseElements(xml, 'p'), + marks: xml.getAttribute('marks') as PunctuationMarks, + placement: xml.getAttribute('placement') as PunctuationPlacement, + }; + } +} + @xmlParser('editorialDecl', EditorialDeclParser) export class EditorialDeclParser extends GenericParser implements Parser { parse(xml: XMLElement): EditorialDecl { @@ -248,7 +262,7 @@ export class EditorialDeclParser extends GenericParser implements Parser(xml, 'hyphenation'), interpretation: queryAndParseElements(xml, 'interpretation'), normalization: queryAndParseElements(xml, 'normalization'), - punctuation: queryAndParseElements(xml, 'punctuation'), + punctuation: queryAndParseElements(xml, 'punctuation'), quotation: queryAndParseElements(xml, 'quotation'), segmentation: queryAndParseElements(xml, 'segmentation'), stdVals: queryAndParseElements(xml, 'stdVals'), diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index 304f4b750..ac9eefdd7 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -8,7 +8,7 @@ import { CharParser, GlyphParser, GParser } from './character-declarations-parse import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; -import { CorrectionParser, EditorialDeclParser, EncodingDescParser, NormalizationParser, ProjectDescParser, SamplingDeclParser } from './header-parser'; +import { CorrectionParser, EditorialDeclParser, EncodingDescParser, NormalizationParser, ProjectDescParser, PunctuationParser, SamplingDeclParser } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, AltIdentifierParser, BindingDescParser, BindingParser, CollationParser, CollectionParser, ConditionParser, @@ -108,6 +108,7 @@ export function ParsersDecl(declarations: Array>) { ProjectDescParser, ProvenanceParser, PtrParser, + PunctuationParser, RdgParser, RecordHistParser, RepositoryParser, From 0c5827d74b7918561e97aa0f227af84e933dc436 Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:30:16 +0100 Subject: [PATCH 08/15] Add Quotation parser --- src/app/models/evt-models.ts | 8 +++++++- src/app/services/xml-parsers/header-parser.ts | 16 ++++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 3 ++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index 8a8358772..b7bdeef5d 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -896,6 +896,12 @@ export class Punctuation extends GenericElement { placement?: PunctuationPlacement; } +export type QuotationMarks = 'none' | 'some' | 'all'; +export class Quotation extends GenericElement { + content: Paragraph[]; + marks?: QuotationMarks; +} + export class EditorialDecl extends GenericElement { structuredData: boolean; correction: Correction[]; @@ -903,7 +909,7 @@ export class EditorialDecl extends GenericElement { interpretation: Array>; // TODO: Add specific type when interpretation is handled normalization: Normalization[]; punctuation: Punctuation[]; - quotation: Array>; // TODO: Add specific type when quotation is handled + quotation: Quotation[]; segmentation: Array>; // TODO: Add specific type when segmentation is handled stdVals: Array>; // TODO: Add specific type when stdVals is handled } diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 67445194f..766b408df 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -5,7 +5,7 @@ import { EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, Normalization, NormalizationMethod, Note, NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Punctuation, PunctuationMarks, PunctuationPlacement, - Resp, RespStmt, SamplingDecl, SeriesStmt, SourceDesc, TitleStmt, XMLElement, + Quotation, QuotationMarks, Resp, RespStmt, SamplingDecl, SeriesStmt, SourceDesc, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; import { NamedEntityRefParser } from './named-entity-parsers'; @@ -251,6 +251,18 @@ export class PunctuationParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): Quotation { + return { + ...super.parse(xml), + type: Quotation, + content: queryAndParseElements(xml, 'p'), + marks: xml.getAttribute('marks') as QuotationMarks, + }; + } +} + @xmlParser('editorialDecl', EditorialDeclParser) export class EditorialDeclParser extends GenericParser implements Parser { parse(xml: XMLElement): EditorialDecl { @@ -263,7 +275,7 @@ export class EditorialDeclParser extends GenericParser implements Parser(xml, 'interpretation'), normalization: queryAndParseElements(xml, 'normalization'), punctuation: queryAndParseElements(xml, 'punctuation'), - quotation: queryAndParseElements(xml, 'quotation'), + quotation: queryAndParseElements(xml, 'quotation'), segmentation: queryAndParseElements(xml, 'segmentation'), stdVals: queryAndParseElements(xml, 'stdVals'), }; diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index ac9eefdd7..8fb97157e 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -8,7 +8,7 @@ import { CharParser, GlyphParser, GParser } from './character-declarations-parse import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; -import { CorrectionParser, EditorialDeclParser, EncodingDescParser, NormalizationParser, ProjectDescParser, PunctuationParser, SamplingDeclParser } from './header-parser'; +import { CorrectionParser, EditorialDeclParser, EncodingDescParser, NormalizationParser, ProjectDescParser, PunctuationParser, QuotationParser, SamplingDeclParser } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, AltIdentifierParser, BindingDescParser, BindingParser, CollationParser, CollectionParser, ConditionParser, @@ -109,6 +109,7 @@ export function ParsersDecl(declarations: Array>) { ProvenanceParser, PtrParser, PunctuationParser, + QuotationParser, RdgParser, RecordHistParser, RepositoryParser, From 3067eee5d3b670b251d5407eb2e11c7a6e7249cb Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:33:09 +0100 Subject: [PATCH 09/15] Add Hyphenation parser --- src/app/models/evt-models.ts | 8 +++++++- src/app/services/xml-parsers/header-parser.ts | 16 ++++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 6 +++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index b7bdeef5d..d8e917e81 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -902,10 +902,16 @@ export class Quotation extends GenericElement { marks?: QuotationMarks; } +export type HyphenationEol = 'all' | 'some' | 'hard' | 'none'; +export class Hyphenation extends GenericElement { + content: Paragraph[]; + eol?: HyphenationEol; +} + export class EditorialDecl extends GenericElement { structuredData: boolean; correction: Correction[]; - hyphenation: Array>; // TODO: Add specific type when hyphenation is handled + hyphenation: Hyphenation[]; interpretation: Array>; // TODO: Add specific type when interpretation is handled normalization: Normalization[]; punctuation: Punctuation[]; diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 766b408df..b0cd38c45 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -2,7 +2,7 @@ import { isNestedInElem } from 'src/app/utils/dom-utils'; import { xmlParser } from '.'; import { Correction, CorrectionMethod, CorrectionStatus, - EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, MsDesc, NamedEntityRef, + EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, Hyphenation, HyphenationEol, MsDesc, NamedEntityRef, Normalization, NormalizationMethod, Note, NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Punctuation, PunctuationMarks, PunctuationPlacement, Quotation, QuotationMarks, Resp, RespStmt, SamplingDecl, SeriesStmt, SourceDesc, TitleStmt, XMLElement, @@ -263,6 +263,18 @@ export class QuotationParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): Hyphenation { + return { + ...super.parse(xml), + type: Hyphenation, + content: queryAndParseElements(xml, 'p'), + eol: xml.getAttribute('eol') as HyphenationEol, + }; + } +} + @xmlParser('editorialDecl', EditorialDeclParser) export class EditorialDeclParser extends GenericParser implements Parser { parse(xml: XMLElement): EditorialDecl { @@ -271,7 +283,7 @@ export class EditorialDeclParser extends GenericParser implements Parser el.tagName === 'p').length !== xml.children.length, correction: queryAndParseElements(xml, 'correction'), - hyphenation: queryAndParseElements(xml, 'hyphenation'), + hyphenation: queryAndParseElements(xml, 'hyphenation'), interpretation: queryAndParseElements(xml, 'interpretation'), normalization: queryAndParseElements(xml, 'normalization'), punctuation: queryAndParseElements(xml, 'punctuation'), diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index 8fb97157e..8547868da 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -8,7 +8,10 @@ import { CharParser, GlyphParser, GParser } from './character-declarations-parse import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; -import { CorrectionParser, EditorialDeclParser, EncodingDescParser, NormalizationParser, ProjectDescParser, PunctuationParser, QuotationParser, SamplingDeclParser } from './header-parser'; +import { + CorrectionParser, EditorialDeclParser, EncodingDescParser, HyphenationParser, NormalizationParser, + ProjectDescParser, PunctuationParser, QuotationParser, SamplingDeclParser, +} from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, AltIdentifierParser, BindingDescParser, BindingParser, CollationParser, CollectionParser, ConditionParser, @@ -76,6 +79,7 @@ export function ParsersDecl(declarations: Array>) { HeadParser, HeightParser, HistoryParser, + HyphenationParser, IncipitParser, InstitutionParser, LayoutDescParser, From f62ca7ae2c0694c0aa34f87b3bc4032448de38f6 Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:34:28 +0100 Subject: [PATCH 10/15] Add Segmentation parser --- src/app/models/evt-models.ts | 6 +++++- src/app/services/xml-parsers/header-parser.ts | 15 +++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index d8e917e81..58af39593 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -908,6 +908,10 @@ export class Hyphenation extends GenericElement { eol?: HyphenationEol; } +export class Segmentation extends GenericElement { + content: Paragraph[]; +} + export class EditorialDecl extends GenericElement { structuredData: boolean; correction: Correction[]; @@ -916,6 +920,6 @@ export class EditorialDecl extends GenericElement { normalization: Normalization[]; punctuation: Punctuation[]; quotation: Quotation[]; - segmentation: Array>; // TODO: Add specific type when segmentation is handled + segmentation: Segmentation[]; stdVals: Array>; // TODO: Add specific type when stdVals is handled } diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index b0cd38c45..c76d0ef28 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -5,7 +5,7 @@ import { EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, Hyphenation, HyphenationEol, MsDesc, NamedEntityRef, Normalization, NormalizationMethod, Note, NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Punctuation, PunctuationMarks, PunctuationPlacement, - Quotation, QuotationMarks, Resp, RespStmt, SamplingDecl, SeriesStmt, SourceDesc, TitleStmt, XMLElement, + Quotation, QuotationMarks, Resp, RespStmt, SamplingDecl, Segmentation, SeriesStmt, SourceDesc, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; import { NamedEntityRefParser } from './named-entity-parsers'; @@ -275,6 +275,17 @@ export class HyphenationParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): Segmentation { + return { + ...super.parse(xml), + type: Segmentation, + content: queryAndParseElements(xml, 'p'), + }; + } +} + @xmlParser('editorialDecl', EditorialDeclParser) export class EditorialDeclParser extends GenericParser implements Parser { parse(xml: XMLElement): EditorialDecl { @@ -288,7 +299,7 @@ export class EditorialDeclParser extends GenericParser implements Parser(xml, 'normalization'), punctuation: queryAndParseElements(xml, 'punctuation'), quotation: queryAndParseElements(xml, 'quotation'), - segmentation: queryAndParseElements(xml, 'segmentation'), + segmentation: queryAndParseElements(xml, 'segmentation'), stdVals: queryAndParseElements(xml, 'stdVals'), }; } diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index 8547868da..f95830383 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -10,7 +10,7 @@ import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; import { CorrectionParser, EditorialDeclParser, EncodingDescParser, HyphenationParser, NormalizationParser, - ProjectDescParser, PunctuationParser, QuotationParser, SamplingDeclParser, + ProjectDescParser, PunctuationParser, QuotationParser, SamplingDeclParser, SegmentationParser, } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, @@ -122,6 +122,7 @@ export function ParsersDecl(declarations: Array>) { ScriptDescParser, SealDescParser, SealParser, + SegmentationParser, SicParser, SourceParser, SummaryParser, From 39616ffdf70ec355321c34924f07d74dc4076fa1 Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:35:50 +0100 Subject: [PATCH 11/15] Add StdVals parser --- src/app/models/evt-models.ts | 6 +++++- src/app/services/xml-parsers/header-parser.ts | 15 +++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index 58af39593..fed8d1996 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -912,6 +912,10 @@ export class Segmentation extends GenericElement { content: Paragraph[]; } +export class StdVals extends GenericElement { + content: Paragraph[]; +} + export class EditorialDecl extends GenericElement { structuredData: boolean; correction: Correction[]; @@ -921,5 +925,5 @@ export class EditorialDecl extends GenericElement { punctuation: Punctuation[]; quotation: Quotation[]; segmentation: Segmentation[]; - stdVals: Array>; // TODO: Add specific type when stdVals is handled + stdVals: StdVals[]; } diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index c76d0ef28..8bac36a06 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -5,7 +5,7 @@ import { EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, Hyphenation, HyphenationEol, MsDesc, NamedEntityRef, Normalization, NormalizationMethod, Note, NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Punctuation, PunctuationMarks, PunctuationPlacement, - Quotation, QuotationMarks, Resp, RespStmt, SamplingDecl, Segmentation, SeriesStmt, SourceDesc, TitleStmt, XMLElement, + Quotation, QuotationMarks, Resp, RespStmt, SamplingDecl, Segmentation, SeriesStmt, SourceDesc, StdVals, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; import { NamedEntityRefParser } from './named-entity-parsers'; @@ -286,6 +286,17 @@ export class SegmentationParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): StdVals { + return { + ...super.parse(xml), + type: StdVals, + content: queryAndParseElements(xml, 'p'), + }; + } +} + @xmlParser('editorialDecl', EditorialDeclParser) export class EditorialDeclParser extends GenericParser implements Parser { parse(xml: XMLElement): EditorialDecl { @@ -300,7 +311,7 @@ export class EditorialDeclParser extends GenericParser implements Parser(xml, 'punctuation'), quotation: queryAndParseElements(xml, 'quotation'), segmentation: queryAndParseElements(xml, 'segmentation'), - stdVals: queryAndParseElements(xml, 'stdVals'), + stdVals: queryAndParseElements(xml, 'stdVals'), }; } } diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index f95830383..b32431a48 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -10,7 +10,7 @@ import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; import { CorrectionParser, EditorialDeclParser, EncodingDescParser, HyphenationParser, NormalizationParser, - ProjectDescParser, PunctuationParser, QuotationParser, SamplingDeclParser, SegmentationParser, + ProjectDescParser, PunctuationParser, QuotationParser, SamplingDeclParser, SegmentationParser, StdValsParser, } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, @@ -125,6 +125,7 @@ export function ParsersDecl(declarations: Array>) { SegmentationParser, SicParser, SourceParser, + StdValsParser, SummaryParser, SuppliedParser, SupportDescParser, From 63cc5fc83096cf30b48a62294f6b1f20a514430e Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:37:20 +0100 Subject: [PATCH 12/15] Add Interpretation parser --- src/app/models/evt-models.ts | 6 +++++- src/app/services/xml-parsers/header-parser.ts | 17 ++++++++++++++--- src/app/services/xml-parsers/xml-parsers.ts | 3 ++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index fed8d1996..5f2338a2d 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -916,11 +916,15 @@ export class StdVals extends GenericElement { content: Paragraph[]; } +export class Interpretation extends GenericElement { + content: Paragraph[]; +} + export class EditorialDecl extends GenericElement { structuredData: boolean; correction: Correction[]; hyphenation: Hyphenation[]; - interpretation: Array>; // TODO: Add specific type when interpretation is handled + interpretation: Interpretation[]; normalization: Normalization[]; punctuation: Punctuation[]; quotation: Quotation[]; diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 8bac36a06..07df15861 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -2,8 +2,8 @@ import { isNestedInElem } from 'src/app/utils/dom-utils'; import { xmlParser } from '.'; import { Correction, CorrectionMethod, CorrectionStatus, - EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, Hyphenation, HyphenationEol, MsDesc, NamedEntityRef, - Normalization, NormalizationMethod, Note, + EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, Hyphenation, HyphenationEol, + Interpretation, MsDesc, NamedEntityRef, Normalization, NormalizationMethod, Note, NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Punctuation, PunctuationMarks, PunctuationPlacement, Quotation, QuotationMarks, Resp, RespStmt, SamplingDecl, Segmentation, SeriesStmt, SourceDesc, StdVals, TitleStmt, XMLElement, } from '../../models/evt-models'; @@ -297,6 +297,17 @@ export class StdValsParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): Interpretation { + return { + ...super.parse(xml), + type: Interpretation, + content: queryAndParseElements(xml, 'p'), + }; + } +} + @xmlParser('editorialDecl', EditorialDeclParser) export class EditorialDeclParser extends GenericParser implements Parser { parse(xml: XMLElement): EditorialDecl { @@ -306,7 +317,7 @@ export class EditorialDeclParser extends GenericParser implements Parser el.tagName === 'p').length !== xml.children.length, correction: queryAndParseElements(xml, 'correction'), hyphenation: queryAndParseElements(xml, 'hyphenation'), - interpretation: queryAndParseElements(xml, 'interpretation'), + interpretation: queryAndParseElements(xml, 'interpretation'), normalization: queryAndParseElements(xml, 'normalization'), punctuation: queryAndParseElements(xml, 'punctuation'), quotation: queryAndParseElements(xml, 'quotation'), diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index b32431a48..99480d373 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -9,7 +9,7 @@ import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; import { - CorrectionParser, EditorialDeclParser, EncodingDescParser, HyphenationParser, NormalizationParser, + CorrectionParser, EditorialDeclParser, EncodingDescParser, HyphenationParser, InterpretationParser, NormalizationParser, ProjectDescParser, PunctuationParser, QuotationParser, SamplingDeclParser, SegmentationParser, StdValsParser, } from './header-parser'; import { @@ -82,6 +82,7 @@ export function ParsersDecl(declarations: Array>) { HyphenationParser, IncipitParser, InstitutionParser, + InterpretationParser, LayoutDescParser, LayoutParser, LBParser, From 2603856dec5b5dbed6d95d98ef586a26bf9c2db5 Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:41:52 +0100 Subject: [PATCH 13/15] Add TagsDecl parser along with Rendition, Namespace and TagUsage parsers --- src/app/models/evt-models.ts | 28 ++++++++- src/app/services/xml-parsers/header-parser.ts | 63 +++++++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 9 ++- 3 files changed, 92 insertions(+), 8 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index 5f2338a2d..54bd66551 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -855,7 +855,7 @@ export class EncodingDesc extends GenericElement { projectDesc: ProjectDesc[]; samplingDecl: SamplingDecl[]; editorialDecl: EditorialDecl[]; - tagsDecl: Array>; // TODO: Add specific type when tagsDecl is handled + tagsDecl: TagsDecl[]; styleDefDecl: Array>; // TODO: Add specific type when styleDefDecl is handled refsDecl: Array>; // TODO: Add specific type when refsDecl is handled classDecl: Array>; // TODO: Add specific type when classDecl is handled @@ -931,3 +931,29 @@ export class EditorialDecl extends GenericElement { segmentation: Segmentation[]; stdVals: StdVals[]; } + +export type RenditionScope = 'first-line' | 'first-letter' | 'before' | 'after'; +export type Scheme = 'css' | 'xslfo' | 'free' | 'other'; +export class Rendition extends GenericElement { + id: string; + scope?: RenditionScope | string; + selector?: string; + scheme?: Scheme; + schemeVersion?: string; +} + +export class TagUsage extends GenericElement { + gi: string; + occurs: number; + withId?: number; +} + +export class Namespace extends GenericElement { + name: string; + tagUsage: TagUsage[]; +} + +export class TagsDecl extends GenericElement { + rendition: Rendition[]; + namespace: Namespace[]; +} diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 07df15861..265a553d8 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -2,14 +2,15 @@ import { isNestedInElem } from 'src/app/utils/dom-utils'; import { xmlParser } from '.'; import { Correction, CorrectionMethod, CorrectionStatus, - EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, Hyphenation, HyphenationEol, - Interpretation, MsDesc, NamedEntityRef, Normalization, NormalizationMethod, Note, + EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, Hyphenation, HyphenationEol, + Interpretation, MsDesc, NamedEntityRef, Namespace, Normalization, NormalizationMethod, Note, NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Punctuation, PunctuationMarks, PunctuationPlacement, - Quotation, QuotationMarks, Resp, RespStmt, SamplingDecl, Segmentation, SeriesStmt, SourceDesc, StdVals, TitleStmt, XMLElement, + Quotation, QuotationMarks, Rendition, RenditionScope, Resp, RespStmt, SamplingDecl, Scheme, Segmentation, + SeriesStmt, SourceDesc, StdVals, TagsDecl, TagUsage, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; import { NamedEntityRefParser } from './named-entity-parsers'; -import { createParser, Parser } from './parser-models'; +import { createParser, getID, Parser } from './parser-models'; @xmlParser('resp', RespParser) export class RespParser extends GenericElemParser implements Parser { @@ -327,6 +328,58 @@ export class EditorialDeclParser extends GenericParser implements Parser { + parse(xml: XMLElement): Rendition { + return { + ...super.parse(xml), + type: Rendition, + id: getID(xml), + scope: xml.getAttribute('scope') as RenditionScope || '', + selector: xml.getAttribute('selector') || '', + scheme: xml.getAttribute('scheme') as Scheme || undefined, + schemeVersion: xml.getAttribute('schemeVersion') || '', + }; + } +} + +@xmlParser('tagUsage', TagUsageParser) +export class TagUsageParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): TagUsage { + return { + ...super.parse(xml), + type: TagUsage, + gi: xml.getAttribute('gi'), + occurs: parseInt(xml.getAttribute('occurs'), 10) || undefined, + withId: parseInt(xml.getAttribute('withId'), 10) || undefined, + }; + } +} + +@xmlParser('namespace', NamespaceParser) +export class NamespaceParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): Namespace { + return { + ...super.parse(xml), + type: Namespace, + name: xml.getAttribute('name') || '', + tagUsage: queryAndParseElements(xml, 'tagUsage'), + }; + } +} + +@xmlParser('tagsDecl', TagsDeclParser) +export class TagsDeclParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): TagsDecl { + return { + ...super.parse(xml), + type: TagsDecl, + rendition: queryAndParseElements(xml, 'rendition'), + namespace: queryAndParseElements(xml, 'namespace'), + }; + } +} + @xmlParser('encodingDesc', EncodingDescParser) export class EncodingDescParser extends GenericParser implements Parser { parse(xml: XMLElement): EncodingDesc { @@ -337,7 +390,7 @@ export class EncodingDescParser extends GenericParser implements Parser(xml, 'projectDesc'), samplingDecl: queryAndParseElements(xml, 'samplingDecl'), editorialDecl: queryAndParseElements(xml, 'editorialDecl'), - tagsDecl: queryAndParseElements(xml, 'tagsDecl'), + tagsDecl: queryAndParseElements(xml, 'tagsDecl'), styleDefDecl: queryAndParseElements(xml, 'styleDefDecl'), refsDecl: queryAndParseElements(xml, 'refsDecl'), classDecl: queryAndParseElements(xml, 'classDecl'), diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index 99480d373..df4337390 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -9,8 +9,9 @@ import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; import { - CorrectionParser, EditorialDeclParser, EncodingDescParser, HyphenationParser, InterpretationParser, NormalizationParser, - ProjectDescParser, PunctuationParser, QuotationParser, SamplingDeclParser, SegmentationParser, StdValsParser, + CorrectionParser, EditorialDeclParser, EncodingDescParser, HyphenationParser, InterpretationParser, + NamespaceParser, NormalizationParser, ProjectDescParser, PunctuationParser, QuotationParser, RenditionParser, + SamplingDeclParser, SegmentationParser, StdValsParser, TagsDeclParser, TagUsageParser, } from './header-parser'; import { AccMatParser, AcquisitionParser, AdditionalParser, AdditionsParser, AdminInfoParser, @@ -98,6 +99,7 @@ export function ParsersDecl(declarations: Array>) { MsPartParser, MusicNotationParser, NamedEntityRefParser, + NamespaceParser, NormalizationParser, NoteParser, ObjectDescParser, @@ -117,6 +119,7 @@ export function ParsersDecl(declarations: Array>) { QuotationParser, RdgParser, RecordHistParser, + RenditionParser, RepositoryParser, RubricParser, SamplingDeclParser, @@ -134,6 +137,8 @@ export function ParsersDecl(declarations: Array>) { SurfaceParser, SurplusParser, SurrogatesParser, + TagsDeclParser, + TagUsageParser, TypeDescParser, TypeNoteParser, VerseParser, From abd6f1764b5b76bed9dc5554860d734c1b091065 Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Mon, 8 Feb 2021 11:45:07 +0100 Subject: [PATCH 14/15] Add RefsDecl parser along with cRefPattern and refState parsers --- src/app/models/evt-models.ts | 20 +++++++- src/app/services/xml-parsers/header-parser.ts | 48 +++++++++++++++++-- src/app/services/xml-parsers/xml-parsers.ts | 8 +++- 3 files changed, 70 insertions(+), 6 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index 54bd66551..5dae28883 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -857,7 +857,7 @@ export class EncodingDesc extends GenericElement { editorialDecl: EditorialDecl[]; tagsDecl: TagsDecl[]; styleDefDecl: Array>; // TODO: Add specific type when styleDefDecl is handled - refsDecl: Array>; // TODO: Add specific type when refsDecl is handled + refsDecl: RefsDecl[]; classDecl: Array>; // TODO: Add specific type when classDecl is handled geoDecl: Array>; // TODO: Add specific type when geoDecl is handled unitDecl: Array>; // TODO: Add specific type when unitDecl is handled @@ -957,3 +957,21 @@ export class TagsDecl extends GenericElement { rendition: Rendition[]; namespace: Namespace[]; } + +export class RefsDecl extends GenericElement { + structuredData: boolean; + cRefPattern: CRefPattern[]; + refState: RefState[]; +} + +export class RefState extends GenericElement { + ed: string; + unit: string; + length: number; + delim?: string; +} + +export class CRefPattern extends GenericElement { + matchPattern: string; + replacementPattern: string; +} diff --git a/src/app/services/xml-parsers/header-parser.ts b/src/app/services/xml-parsers/header-parser.ts index 265a553d8..c632f0e68 100644 --- a/src/app/services/xml-parsers/header-parser.ts +++ b/src/app/services/xml-parsers/header-parser.ts @@ -1,11 +1,11 @@ import { isNestedInElem } from 'src/app/utils/dom-utils'; import { xmlParser } from '.'; import { - Correction, CorrectionMethod, CorrectionStatus, + Correction, CorrectionMethod, CorrectionStatus, CRefPattern, EditionStmt, EditorialDecl, EncodingDesc, Extent, FileDesc, GenericElement, Hyphenation, HyphenationEol, Interpretation, MsDesc, NamedEntityRef, Namespace, Normalization, NormalizationMethod, Note, NotesStmt, Paragraph, ProjectDesc, PublicationStmt, Punctuation, PunctuationMarks, PunctuationPlacement, - Quotation, QuotationMarks, Rendition, RenditionScope, Resp, RespStmt, SamplingDecl, Scheme, Segmentation, + Quotation, QuotationMarks, RefsDecl, RefState, Rendition, RenditionScope, Resp, RespStmt, SamplingDecl, Scheme, Segmentation, SeriesStmt, SourceDesc, StdVals, TagsDecl, TagUsage, TitleStmt, XMLElement, } from '../../models/evt-models'; import { GenericElemParser, GenericParser, queryAndParseElement, queryAndParseElements } from './basic-parsers'; @@ -380,6 +380,48 @@ export class TagsDeclParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): CRefPattern { + return { + ...super.parse(xml), + type: CRefPattern, + matchPattern: xml.getAttribute('matchPattern'), + replacementPattern: xml.getAttribute('replacementPattern'), + }; + } +} + +@xmlParser('refState', RefStateParser) +export class RefStateParser extends GenericElemParser implements Parser { + parse(xml: XMLElement): RefState { + return { + ...super.parse(xml), + type: RefState, + ed: xml.getAttribute('ed'), + unit: xml.getAttribute('unit'), + length: parseInt(xml.getAttribute('length'), 10) || 0, + delim: xml.getAttribute('delim'), + }; + } +} + +@xmlParser('refsDecl', RefsDeclParser) +export class RefsDeclParser extends GenericElemParser implements Parser { + cRefPatternParser = createParser(CRefPatternParser, this.genericParse); + refStateParser = createParser(RefStateParser, this.genericParse); + + parse(xml: XMLElement): RefsDecl { + return { + ...super.parse(xml), + type: RefsDecl, + structuredData: Array.from(xml.children).filter(el => el.tagName === 'p').length !== xml.children.length, + cRefPattern: queryAndParseElements(xml, 'cRefPattern'), + refState: queryAndParseElements(xml, 'refState'), + }; + } +} + @xmlParser('encodingDesc', EncodingDescParser) export class EncodingDescParser extends GenericParser implements Parser { parse(xml: XMLElement): EncodingDesc { @@ -392,7 +434,7 @@ export class EncodingDescParser extends GenericParser implements Parser(xml, 'editorialDecl'), tagsDecl: queryAndParseElements(xml, 'tagsDecl'), styleDefDecl: queryAndParseElements(xml, 'styleDefDecl'), - refsDecl: queryAndParseElements(xml, 'refsDecl'), + refsDecl: queryAndParseElements(xml, 'refsDecl'), classDecl: queryAndParseElements(xml, 'classDecl'), geoDecl: queryAndParseElements(xml, 'geoDecl'), unitDecl: queryAndParseElements(xml, 'unitDecl'), diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index df4337390..e3873acba 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -9,8 +9,9 @@ import { ChoiceParser } from './choice-parser'; import { SicParser, SurplusParser } from './editorial-parsers'; import { GraphicParser, SurfaceParser, ZoneParser } from './facsimile-parser'; import { - CorrectionParser, EditorialDeclParser, EncodingDescParser, HyphenationParser, InterpretationParser, - NamespaceParser, NormalizationParser, ProjectDescParser, PunctuationParser, QuotationParser, RenditionParser, + CorrectionParser, CRefPatternParser, EditorialDeclParser, EncodingDescParser, HyphenationParser, InterpretationParser, + NamespaceParser, NormalizationParser, ProjectDescParser, PunctuationParser, QuotationParser, + RefsDeclParser, RefStateParser, RenditionParser, SamplingDeclParser, SegmentationParser, StdValsParser, TagsDeclParser, TagUsageParser, } from './header-parser'; import { @@ -57,6 +58,7 @@ export function ParsersDecl(declarations: Array>) { CollectionParser, ConditionParser, CorrectionParser, + CRefPatternParser, CustEventParser, CustodialHistParser, DamageParser, @@ -119,6 +121,8 @@ export function ParsersDecl(declarations: Array>) { QuotationParser, RdgParser, RecordHistParser, + RefsDeclParser, + RefStateParser, RenditionParser, RepositoryParser, RubricParser, From 21ed5e7bee7d396923a956eec26203dd43045aab Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Tue, 9 Feb 2021 14:42:26 +0100 Subject: [PATCH 15/15] Refactor data models --- src/app/models/evt-models.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index 5dae28883..cf25c295d 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -875,36 +875,31 @@ export class SamplingDecl extends GenericElement { export type CorrectionStatus = 'high' | 'medium' | 'low' | 'unknown'; export type CorrectionMethod = 'silent' | 'markup'; -export class Correction extends GenericElement { - content: Paragraph[]; +export class Correction extends ProjectDesc { status?: CorrectionStatus; method?: CorrectionMethod; } export type NormalizationMethod = 'silent' | 'markup'; -export class Normalization extends GenericElement { - content: Paragraph[]; +export class Normalization extends ProjectDesc { method: NormalizationMethod; sources: string[]; } export type PunctuationMarks = 'none' | 'some' | 'all'; export type PunctuationPlacement = 'internal' | 'external'; -export class Punctuation extends GenericElement { - content: Paragraph[]; +export class Punctuation extends ProjectDesc { marks?: PunctuationMarks; placement?: PunctuationPlacement; } export type QuotationMarks = 'none' | 'some' | 'all'; -export class Quotation extends GenericElement { - content: Paragraph[]; +export class Quotation extends ProjectDesc { marks?: QuotationMarks; } export type HyphenationEol = 'all' | 'some' | 'hard' | 'none'; -export class Hyphenation extends GenericElement { - content: Paragraph[]; +export class Hyphenation extends ProjectDesc { eol?: HyphenationEol; }