Add new class MDConcCertainty

This commit is contained in:
Joshua Ramon Enslin 2025-03-18 01:22:59 +01:00
parent 7765ed2e96
commit fdb47f9f63
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
3 changed files with 46 additions and 0 deletions

43
src/MDConcCertainty.php Normal file
View File

@ -0,0 +1,43 @@
<?PHP
/**
* Mapping for certainty-expressing fields to certainty in events.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Mapping for certainty-expressing fields to certainty in events.
*/
final class MDConcCertainty implements MDImporterConcordanceListInterface {
private const MAPPING = [
// Uncertain
'fraglich' => false,
// Certain
'sicher' => true,
'by' => true,
];
/**
* Require a function for getting the concordance target.
*
* @param string $input Input string.
*
* @return boolean
*/
public static function getConcordanceTarget(string $input):bool {
if (!isset(self::MAPPING[$input])) {
throw new MDImporterMissingConcordance("Unknown certainty identifier: " . $input);
}
return self::MAPPING[$input];
}
}

View File

@ -48,6 +48,7 @@ enum MDConcFieldRelatedWorksType {
"Teil von",
"ist Teil von",
"ist physischer Teil von",
"Gehört zu",
"gehört zu",
"Gehört zu Sammlung",

View File

@ -174,6 +174,7 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"(Höhe)",
" (Höhe)",
"Höhe (gesamt)",
"Höhe (Blatt)",
"Höhe (ausgeklappt)",
"height",
"height (overall)",
@ -228,6 +229,7 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"Breite H",
"Breite (ausgeklappt)",
"Breite (aufgeschlagen)",
"Breite (Blatt)",
"Breite (gesamt)",
"(Breite)",
"Lichtmass (Breite)",