Skip to content

Commit

Permalink
Secondary data type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mau Zsofia Abraham committed Nov 29, 2024
1 parent 2b3d28d commit 515ad7d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions composables/use-tei-headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const extractMetadata = function (
"@hasTEIw": "false",
teiHeader: item.teiHeader,
} as simpleTEIMetadata;

template.id = item["@id"]
? item["@id"]
: item.teiHeader.fileDesc.publicationStmt.idno?.$
Expand Down Expand Up @@ -137,23 +136,26 @@ const extractMetadata = function (

template.person = extractPersons(item, corpusMetadata);
if (template.dataType === "CorpusText" && corpusMetadata) {
const subtype = item.teiHeader.profileDesc?.textClass?.catRef
const categoryId = item.teiHeader.profileDesc?.textClass?.catRef
? item.teiHeader.profileDesc.textClass.catRef["@target"]
: "";

const subtype = categoryId?.split(".").at(2);

switch (subtype) {
case "corpus:textClass.ST":
case "ST":
template.secondaryDataType = "Sample Text";
break;
case "corpus:textClass.FL":
case "FL":
template.secondaryDataType = "Feature List";
break;
case "corpus:textClass.FS":
template.secondaryDataType = "Free Speech";
case "UMS":
template.secondaryDataType = "Unmonitored Speech";
break;
case "corpus:textClass.TUN":
case "TUN":
template.secondaryDataType = "Tunocent Questionnaire";
break;
case "corpus:textClass.WAD":
case "WAD":
template.secondaryDataType = "WAD Questionnaire";
break;
default:
Expand Down

0 comments on commit 515ad7d

Please sign in to comment.