format controller name
@param  string $name
@return string
165418
protected function formatControllerName($name)
	{
	    $name = str_replace('..', '.', $name);
	    $name = str_replace('./', '', $name);
	    return DataHelper::formatCode($name);
	}
95169
protected static function _normalizeName($name)
    {
        $name = ucfirst(strtolower($name));
        $name = str_replace(array('-', '_', '.'), ' ', $name);
        $name = ucwords($name);
        $name = str_replace(' ', '', $name);
        if (stripos($name, 'ZendServer') === 0) {
            $name = 'ZendServer_' . substr($name, strlen('ZendServer'));
        }

        return $name;
    }
218190
public function quoteTableName($name)
    {
        if (false === strpos($name, '.')) {
            return $this->quoteSimpleTableName($name);
        }
        $parts = explode('.', $name);
        foreach ($parts as $i => $part) {
            $parts[$i] = $this->quoteSimpleTableName($part);
        }
        return implode('.', $parts);
    }
108404
public function prefix($name)
    {
        if ($prefix = $this->config()->attribute['prefix']) {
            
            if (strpos($name, $prefix) !== 0) {
                return sprintf('%s%s', $prefix, $name);
            }
            
        }
        
        return $name;
    }
1232830
protected function translateName($name)
    {
        if ($name === '/index.php') {
            return '';
        }

        $name = ltrim($name, '/');
        $name = rtrim($name, '/');

        return preg_replace('/[^A-Za-z0-9\-_]/', '', strtr($name, [
            '/' => '_',
            '.md' => '',
        ]));
    }
350604
protected function cleanName(string $name) : string
    {
        if ('._ids' === substr($name, -5)) {
            $name = substr($name, 0, -5);
        }

        if (false !== strpos($name, '.')) {
            $fieldElements = explode('.', $name);
            $name = false !== end($fieldElements) ? end($fieldElements) : $name;
        }

        if (substr($name, -3) === '_id') {
            $name = substr($name, 0, -3);
        }
        $name = Inflector::humanize(Inflector::underscore($name));

        return $name;
    }
746696
protected function inflectName($name)
	{
		if (! $this->inflector) {
			$this->inflector = new Filter\Word\CamelCaseToDash();
		}

		return strtolower($this->inflector->filter($name));
	}
88393
public function format(Name $name)
    {
        $names = [
            'p-honorific-prefix' => $name->getPrefix(),
            'p-nickname' => $name->getNick(),
            'p-given-name' => $name->getGiven(),
            'p-additional-name' => $name->getMiddle(),
            'p-family-name' => $name->getSurname(),
            'p-honorific-suffix' => $name->getSuffix(),
            'p-maiden-name' => $name->getMaiden()
        ];
        $tags = [];
        foreach ($names as $k => $v) {
            if (strlen($v) > 0) {
                $tags[] = '<span class="' . $k . '">' . htmlspecialchars($v) . '</span>';
            }
        }
        $maiden = $name->getMaiden();
        if (strlen($maiden) > 0) {
            $tags[] = '(née <span class="p-maiden-name">' . htmlspecialchars($names['p-maiden-name']) . '</span>)';
        }
        return '<span class="p-name">' . implode(' ', $tags) . '</span>';
    }
157238
private function quoteSimpleName(string $name): string
    {
        $parts = explode('.', $name);
        foreach ($parts as $i => $part) {
            $parts[$i] = sprintf('`%s`', $part);
        }
        return implode('.', $parts);
    }
1073228
protected function normalizeName($name)
    {
        $name = strtr(strtolower($name), '_', '-');

        if (strpos($name, 'http-') === 0) {
            $name = substr($name, 5);
        }

        return $name;
    }
196824
public function format($name, array $data) {
        $name = $this->_getTemplateName($name, $data);
        return parent::format($name, $data);
    }
1144021
public function quoteTable(string $name): string
    {
        if (preg_match('#^(' . $this->nameRegex . ')$#i', $name)) {
            return static::quoteName($name);
        }

        return static::quote($name);
    }
525549
private function parse_name($name) {
        $bits = explode('/', $name);
        $name = array_pop($bits);
        $plugin = '';
        if ($bits) {
            $plugin = array_pop($bits);
            if ($plugin === 'moodle') {
                $plugin = '';
            }
        }
        return 's_'.$plugin.'_'.$name;
    }
1035738
protected function formatIndex($name)
    {
        if (\is_string($name)) {
            $exp = explode('.', $name);

            if (0 < \count($exp)) {
                $name = $exp[\count($exp) - 1];
            }
        }

        return $name;
    }
348170
public function getFormat($name)
    {
        if (empty($this->formats[$name]) || !($this->formats[$name] instanceof FormatInterface)) {
            $class = sprintf('Windwalker\\Language\\Format\\%sFormat', $name);

            if (!class_exists($class)) {
                throw new \DomainException('Format ' . $name . ' not support. Class: ' . $class . ' not found');
            }

            $this->formats[$name] = new $class();
        }

        return $this->formats[$name];
    }
750986
private function underscore($name)
    {
        $result = preg_replace('/([A-Z]|[0-9]+)/', "_$1", $name);
        $result = trim($result, '_');
        $result = strtolower($result);
        
        return $result;
    }
149213
public function p($name)
    {
        $msg = $this->raw($name);
        if (!$msg) {
            return '';
        }
        return sprintf($this->format, $msg);
    }