diff --git a/CHANGELOG.md b/CHANGELOG.md index 8135ac04b..bfd439cfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - -## [1.0.0-alpha] - 2022-12-07 +## [1.0.0-alpha] - 2024-02-20 ### Dependency Updates - Updated to Angular 13 @@ -87,6 +87,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Named entities visualisation - Named entities extraction - OpenSeadragon component with support for manifest file +- Analogues and sources extraction and configuration +- Analogues and sources visualization ### Changed - Routing params keys diff --git a/src/app/components/sources/sources.component.scss b/src/app/components/sources/sources.component.scss index 824de0ef5..4e542789b 100644 --- a/src/app/components/sources/sources.component.scss +++ b/src/app/components/sources/sources.component.scss @@ -32,7 +32,7 @@ } .source-quote-symbol { - font-size: 1em; + font-size: 1rem; color: #263238; margin: 0; padding: 0 0.3rem 0 0; diff --git a/src/app/services/xml-parsers/analogue-parser.ts b/src/app/services/xml-parsers/analogue-parser.ts index 7e6576537..e99ba434c 100644 --- a/src/app/services/xml-parsers/analogue-parser.ts +++ b/src/app/services/xml-parsers/analogue-parser.ts @@ -9,7 +9,6 @@ import { BasicParser } from './quotes-parser'; @xmlParser('evt-analogue-entry-parser', AnalogueParser) export class AnalogueParser extends BasicParser implements Parser { - elementParser = createParser(GenericElemParser, parse); attributeParser = createParser(AttributeParser, this.genericParse); biblParser = createParser(BibliographyParser, this.genericParse); @@ -37,7 +36,7 @@ export class AnalogueParser extends BasicParser implements Parser { return { type: Analogue, - id: (notableElements.includes(analogue.tagName)) ? 'EVT-ANG:'+getID(analogue) : getID(analogue), + id: (notableElements.includes(analogue.tagName)) ? 'EVT-ANALOGUE:' + getID(analogue) : getID(analogue), class: AnalogueClass, attributes: this.attributeParser.parse(analogue), text: normalizeSpaces(chainFirstChildTexts(analogue, this.evtTextComplexElements, this.evtInnerTextElements)), @@ -107,6 +106,7 @@ export class AnalogueParser extends BasicParser implements Parser { return ppElements.concat(addendum.flat()); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private getQuotedTextFromSources(nodes: BibliographicEntry[]): any { let quotesInSources = []; nodes.forEach((el: BibliographicEntry|BibliographicList) => { diff --git a/src/app/services/xml-parsers/bilbliography-parsers.ts b/src/app/services/xml-parsers/bilbliography-parsers.ts index eabcb8ecb..8dd144837 100644 --- a/src/app/services/xml-parsers/bilbliography-parsers.ts +++ b/src/app/services/xml-parsers/bilbliography-parsers.ts @@ -39,6 +39,7 @@ export class BibliographyParser extends BasicParser implements Parser { elementParser = createParser(GenericElemParser, this.genericParse); @@ -60,8 +55,7 @@ export class QuoteParser extends BasicParser implements Parser { case 'lg': case 'l': case 'note': - // if they are not a source send them to their parse - // otherwise create a note + // if they are not a source send them to their parse otherwise create a note if (notSource) { return ParserRegister.get(quote.tagName).parse(quote) as Paragraph|VersesGroup|Verse|Note; } @@ -78,8 +72,7 @@ export class QuoteParser extends BasicParser implements Parser { return divElement; case 'ptr': - // if it's not a source send it to its parse - // otherwise parse here + // if it's not a source send it to its parse, otherwise it will be parsed here later if (notSource) { return ParserRegister.get(quote.tagName).parse(quote) as Ptr; } @@ -87,8 +80,7 @@ export class QuoteParser extends BasicParser implements Parser { case 'ref': case 'seg': case 'cit': - // if they are not a source create a generic element - // otherwise parse here + // if they are not a source create a generic element, otherwise it will be parsed here later if (notSource) { return ParserRegister.get('evt-generic-elem-parser').parse(quote) as GenericElement; } @@ -165,7 +157,7 @@ export class QuoteParser extends BasicParser implements Parser { /** - * Retrieve attributes linked to external bibl/listBibl/cit elements + * Retrieve attributes linked to external bibl, listBibl, cit elements */ private findExtRef(quote: XMLElement, isInCitElem: boolean): XMLElement { const target = (isInCitElem) ? quote.parentElement : quote; @@ -180,8 +172,9 @@ export class QuoteParser extends BasicParser implements Parser { /** * Retrieve and send to the proper parsing all bibliography elements inside the quote element * @param quote XMLElement - * @returns array of Bibliography Element or a single Bibliography List element + * @returns array of XML Elements */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any private getInsideSources(quote: XMLElement, isInCit: boolean): { sources:any, analogues:any } { const prsRg = { bibl: this.biblParser, @@ -289,7 +282,7 @@ export class QuoteParser extends BasicParser implements Parser { return quotesInSources; } - private createNote(quote: XMLElement) { + private createNote(quote: XMLElement): QuoteEntry { // const sources = this.getInsideSources(quote, false); // not parsing inside sources, they will be parsed anyway const isCit = ((quote.tagName === 'cit') || (quote.tagName === 'note')); @@ -299,7 +292,7 @@ export class QuoteParser extends BasicParser implements Parser { return { type: QuoteEntry, - id: 'EVT-SRC:' + getID(quote), + id: 'EVT-SOURCE:' + getID(quote), tagName: quote.tagName, attributes: this.attributeParser.parse(quote), text: normalizeSpaces(this.getQuotedTextInside(quote, isCit, isDiv)), diff --git a/src/app/services/xml-parsers/source-entries-parser.service.ts b/src/app/services/xml-parsers/source-entries-parser.service.ts index 6e6fe8cf5..c75bebf07 100644 --- a/src/app/services/xml-parsers/source-entries-parser.service.ts +++ b/src/app/services/xml-parsers/source-entries-parser.service.ts @@ -10,8 +10,8 @@ export class SourceEntriesParserService { const quoteParser = ParserRegister.get('evt-quote-entry-parser'); return [ - Array.from(document.querySelectorAll(`.${SourceClass}`)) - .map((srcEntry) => quoteParser.parse(srcEntry) as QuoteEntry), + Array.from(document.querySelectorAll(`.${SourceClass}`)) + .map((srcEntry) => quoteParser.parse(srcEntry) as QuoteEntry), ]; } }