Add new class MDConcCertainty
This commit is contained in:
parent
7765ed2e96
commit
fdb47f9f63
43
src/MDConcCertainty.php
Normal file
43
src/MDConcCertainty.php
Normal 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];
|
||||
|
||||
}
|
||||
}
|
@ -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",
|
||||
|
@ -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)",
|
||||
|
Loading…
x
Reference in New Issue
Block a user