2022-04-02 00:55:38 +02:00
|
|
|
|
<?PHP
|
|
|
|
|
/**
|
|
|
|
|
* Constains lists for categorizing misspelled sizes.
|
|
|
|
|
*
|
|
|
|
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
|
|
|
|
*/
|
|
|
|
|
declare(strict_types = 1);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Provides lists for categorizing misspelled sizes.
|
|
|
|
|
*/
|
2023-05-14 12:11:23 +02:00
|
|
|
|
final class MDConcLengths implements MDImporterConcordanceListInterface {
|
2022-04-02 00:55:38 +02:00
|
|
|
|
|
2023-05-14 12:11:23 +02:00
|
|
|
|
private const LENGTHS_LIST = [
|
2023-10-17 00:35:50 +02:00
|
|
|
|
|
|
|
|
|
// Default: Empty
|
|
|
|
|
"Breite" => "",
|
|
|
|
|
"breite" => "",
|
|
|
|
|
"Width" => "",
|
|
|
|
|
"width" => "",
|
|
|
|
|
"Höhe" => "",
|
|
|
|
|
"höhe" => "",
|
|
|
|
|
"Height" => "",
|
|
|
|
|
"height" => "",
|
|
|
|
|
"´´´" => "",
|
|
|
|
|
"Theater" => "",
|
|
|
|
|
"Oper" => "",
|
|
|
|
|
"min" => "",
|
|
|
|
|
"-" => "",
|
|
|
|
|
"a)" => "",
|
|
|
|
|
"/" => "",
|
|
|
|
|
"geöffnet" => "",
|
|
|
|
|
|
|
|
|
|
// cm
|
|
|
|
|
"cn" => "cm",
|
|
|
|
|
",cm" => "cm",
|
|
|
|
|
"5cm" => "cm",
|
|
|
|
|
"Zentimeter" => "cm",
|
|
|
|
|
"ca" => "cm", // This is likely a typo
|
2023-10-16 22:39:16 +02:00
|
|
|
|
|
|
|
|
|
"Meter" => "m",
|
|
|
|
|
"Meters" => "m",
|
|
|
|
|
"meter" => "m",
|
|
|
|
|
"meters" => "m",
|
|
|
|
|
|
|
|
|
|
"Milimeter" => "mm",
|
|
|
|
|
"Milimeters" => "mm",
|
|
|
|
|
"Millimeter" => "mm",
|
|
|
|
|
"Millimeters" => "mm",
|
2022-09-02 02:10:36 +02:00
|
|
|
|
|
|
|
|
|
"inch" => "in",
|
|
|
|
|
"Zoll" => "in",
|
|
|
|
|
"zoll" => "in",
|
2022-04-02 00:55:38 +02:00
|
|
|
|
];
|
|
|
|
|
|
2023-05-14 12:11:23 +02:00
|
|
|
|
/**
|
|
|
|
|
* Require a function for getting the concordance target.
|
|
|
|
|
*
|
|
|
|
|
* @param string $input Input string.
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public static function getConcordanceTarget(string $input):string {
|
|
|
|
|
|
|
|
|
|
if (!isset(self::LENGTHS_LIST[$input])) {
|
|
|
|
|
throw new MDImporterMissingConcordance("Unknown length type: " . $input);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return self::LENGTHS_LIST[$input];
|
|
|
|
|
|
|
|
|
|
}
|
2022-04-02 00:55:38 +02:00
|
|
|
|
}
|