public function normalize(string $input): string
    {
        $output = preg_replace_callback(self::$pattern,
            function($matches) {
                $int = $matches['int'];
                switch ($matches['time']) {
                    case 's':
                        $t = ($int == 1) ? ' second ' : ' seconds ';
                        break;
                    case 'm':
                        $t = ($int == 1) ? ' minute ' : ' minutes ';
                        break;
                    case 'h':
                        $t = ($int == 1) ? ' hour ' : ' hours ';
                        break;
                    case 'd':
                        $t = ($int == 1) ? ' day ' : ' days ';
                        break;
                    case 'w':
                        $t = ($int == 1) ? ' week ' : ' weeks ';
                        break;
                    case 'mon':
                        $t = ($int == 1) ? ' month ' : ' months ';
                        break;
                    case 'y':
                        $t = ($int == 1) ? ' year ' : ' years ';
                        break;
                }

                $t = $t ?? '';
                # rebuild the interval string
                $time = $int . $t;

                if (isset($matches['text'])) {
                    $time .= trim($matches['text']);
                }

                return $time;

            }, $input);

        return trim($output);
    }