*/ declare(strict_types = 1); /** * Provides lists for categorizing misspelled sizes. */ final class MDConcLengths implements MDImporterConcordanceListInterface { private const LENGTHS_LIST = [ // Default: Empty "Breite" => "", "breite" => "", "Width" => "", "width" => "", "Höhe" => "", "höhe" => "", "Height" => "", "height" => "", "´´´" => "", "Theater" => "", "Oper" => "", "min" => "", "-" => "", "a)" => "", "/" => "", "geöffnet" => "", "Scheibe" => "", "Trageöse" => "", // cm "cn" => "cm", ",cm" => "cm", "5cm" => "cm", "Zentimeter" => "cm", "ca" => "cm", // This is likely a typo "Meter" => "m", "Meters" => "m", "meter" => "m", "meters" => "m", "Milimeter" => "mm", "Milimeters" => "mm", "Millimeter" => "mm", "Millimeters" => "mm", "ma" => "mm", // Either a typo for mm, or miliamper? "inch" => "in", "Zoll" => "in", "zoll" => "in", ]; /** * 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]; } }