Returns an array of decoration tokens from the translation key
@return \string[]
541426
public function decorationTokens() {
        if ($this->decoration_tokens == null) {
            $dt = new DecorationTokenizer($this->label);
            $dt->parse();
            $this->decoration_tokens = $dt->tokens;
        }

        return $this->decoration_tokens;
    }
964863
public function getLabels()
    {
        $languages = array_keys(Helpers::getLanguageItems($this->fields));

        if (count($languages) > 0) {
            return $this->getTranslatedLabels($languages);
        }

        return $this->getPlainLabels();
    }
12914
protected function getLocaleChoices()
    {
        $locale = [];

        foreach ($this->languages as $language) {
            $locale[$language['label']] = $language['locale'];
        }

        return $locale;
    }
1361146
public function tags(): array
    {

        if (property_exists($this, 'tags')) {
            if (is_null($this->token))
                return array_merge($this->tags, ['public']);

            return array_merge($this->tags, ['character_id:' . $this->getCharacterId()]);
        }

        if (is_null($this->token))
            return ['unknown_tag', 'public'];

        return ['unknown_tag', 'character_id:' . $this->getCharacterId()];
    }
57378
public function getTokens(): array
    {
        $response = $this
            ->httpClient
            ->get(
                sprintf(
                    '/%s/tokens',
                    $this->getAppUUID()->getId()
                ),
                'get',
                [],
                [],
                Http::getApisearchHeaders($this)
            );

        self::throwTransportableExceptionIfNeeded($response);

        return array_map(function (array $token) {
            return Token::createFromArray($token);
        }, $response['body']);
    }
1033921
protected function getDefaultFormats()
    {
        return [
            [
                'type' => Token::TYPE_KEYWORD,
                'flags' => Token::FLAG_KEYWORD_RESERVED,
                'html' => 'class="sql-reserved"',
                'cli' => "\x1b[35m",
                'function' => 'strtoupper',
            ],
            [
                'type' => Token::TYPE_KEYWORD,
                'flags' => 0,
                'html' => 'class="sql-keyword"',
                'cli' => "\x1b[95m",
                'function' => 'strtoupper',
            ],
            [
                'type' => Token::TYPE_COMMENT,
                'flags' => 0,
                'html' => 'class="sql-comment"',
                'cli' => "\x1b[37m",
                'function' => '',
            ],
            [
                'type' => Token::TYPE_BOOL,
                'flags' => 0,
                'html' => 'class="sql-atom"',
                'cli' => "\x1b[36m",
                'function' => 'strtoupper',
            ],
            [
                'type' => Token::TYPE_NUMBER,
                'flags' => 0,
                'html' => 'class="sql-number"',
                'cli' => "\x1b[92m",
                'function' => 'strtolower',
            ],
            [
                'type' => Token::TYPE_STRING,
                'flags' => 0,
                'html' => 'class="sql-string"',
                'cli' => "\x1b[91m",
                'function' => '',
            ],
            [
                'type' => Token::TYPE_SYMBOL,
                'flags' => 0,
                'html' => 'class="sql-variable"',
                'cli' => "\x1b[36m",
                'function' => '',
            ],
        ];
    }
1178797
private function _getConvertingDictionary ( ) {
        $definedColors = DecorationsObject::getDefinedColors();
        foreach ( $definedColors as $colorName => $escapeSequences ) {
            list($textColorEscapeSequence, $backgroundColorEscapeSequence) = $escapeSequences;
            $patterns[] = "|<tc:$colorName>|";
            $replacements[] = $textColorEscapeSequence;
            $patterns[] = "|<bc:$colorName>|";
            $replacements[] = $backgroundColorEscapeSequence;
        }

        $resetEscapeSequences = $definedColors['reset'];
        $patterns[] = '|</tc>|';
        $replacements[] = $resetEscapeSequences[0];
        $patterns[] = '|</bc>|';
        $replacements[] = $resetEscapeSequences[1];

        $definedStyles = DecorationsObject::getDefinedStyles();
        $resetEscapeSequence = $definedStyles['reset'];
        foreach ( $definedStyles as $styleName => $escapeSequence ) {
            $patterns[] = "|<$styleName>|";
            $replacements[] = $escapeSequence;
            $patterns[] = "|</$styleName>|";
            $replacements[] = $escapeSequence;
        }

        $dictionary = array($patterns, $replacements);
        return $dictionary;
    }
67957
public function getNamedCaptures()
	{
		$captures   = [];
		$regexpInfo = RegexpParser::parse($this->regexp);

		// Prepare the start/end of the regexp and ensure that we use the D modifier
		$start = $regexpInfo['delimiter'] . '^';
		$end   = '$' . $regexpInfo['delimiter'] . $regexpInfo['modifiers'];
		if (strpos($regexpInfo['modifiers'], 'D') === false)
		{
			$end .= 'D';
		}

		foreach ($this->getNamedCapturesExpressions($regexpInfo['tokens']) as $name => $expr)
		{
			$captures[$name] = $start . $expr . $end;
		}

		return $captures;
	}
428810
protected function lexUnionMemberTypes(): array
    {
        $types = [];

        if ($this->skip(TokenKindEnum::EQUALS)) {
            // Optional leading pipe
            $this->skip(TokenKindEnum::PIPE);

            do {
                $types[] = $this->lexNamedType();
            } while ($this->skip(TokenKindEnum::PIPE));
        }

        return $types;
    }
156983
public function getTranslations($key): array
    {
        $this->guardAgainstNonTranslatableAttribute($key);
        $value = json_decode($this->getAttributes()[$key] ?? '' ?: '{}', true);

        // Inject default translation if none supplied
        if (! is_array($value)) {
            $oldValue = $value;

            if ($this->hasSetMutator($key)) {
                $method = 'set'.studly_case($key).'Attribute';
                $value = $this->{$method}($value);
            }

            $value = [$locale = app()->getLocale() => $value];

            $this->attributes[$key] = $this->asJson($value);
            event(new TranslationHasBeenSet($this, $key, $locale, $oldValue, $value));
        }

        return $value;
    }
724407
protected function getEscapedCharacters() : array
    {
        if (self::$escapedSpecialCharacters !== null) {
            return self::$escapedSpecialCharacters;
        }

        return self::$escapedSpecialCharacters = \array_values(self::$specialCharactersMapping);
    }
1052717
private function translatePattern()
    {
        $tokenArray = $this->extractTokens( $this->namePattern );
        $objectName = $this->namePattern;

        foreach( $tokenArray as $token )
        {
            $string = $this->resolveToken( $token );
            $objectName = str_replace( $token, $string, $objectName );
        }

        return $objectName;
    }
164586
public function getStaticTokens()
    {
        $tokens = [];
        $sites = [];
        if (!$this->getValid()) {
            return $sites;
        }
        foreach ($this->xml->children() as $child) {
            if ($child->getName() == "token") {
                $token = $this->parseToken($child);
                if ($token !== false) {
                    $tokens[$token['token']] = $token;
                }
            }
        }
        return $tokens;
    }
417542
private static function _getCharMap(): array
    {
        // Keep local copy
        static $map = [];

        if (empty($map)) {
            // This will replace accented chars with non-accented chars
            foreach (StringHelper::asciiCharMap() as $asciiChar => $charsArray) {
                foreach ($charsArray as $char) {
                    $map[$char] = $asciiChar;
                }
            }

            // Replace punctuation with a space
            foreach (self::_getPunctuation() as $value) {
                $map[$value] = ' ';
            }
        }

        // Return the char map
        return $map;
    }
662456
private function queryTokens()
    {
        $tokens = $this->getTokens();

        $queryNorm = $this->getQueryNorm($tokens);
        $results = array();
        foreach ($tokens as $token) {
            $results[$token] = $this->getResultsForToken($token, $queryNorm);
        }
        return $results;
    }
496794
public function getDecoratedHeaders(): array
    {
        $decoratedHeaders = [];
        foreach ($this->headers as $name => $value) {
            $decoratedHeaders[] = $name . ': ' . $value;
        }
        return $decoratedHeaders;
    }
601937
public function getRootPageLanguageIds() : array
    {
        $rootPageLanguageIds = [];
        $rootPageId = $this->getRootPageId();
        $rootPageOverlays = $this->pagesRepository->findTranslationOverlaysByPageId($rootPageId);
        if (count($rootPageOverlays)) {
            foreach ($rootPageOverlays as $rootPageOverlay) {
                $rootPageLanguageIds[] = $rootPageOverlay['sys_language_uid'];
            }
        }
        return $rootPageLanguageIds;
    }