Prepares tag words.
@return string[]
422021
protected function prepareWords()
    {
        $cleanHtml = HtmlPurifier::process(trim($this->content));
        $purged = preg_replace('/<[^>]+>/', ' ', $cleanHtml);
        $wordsRaw = array_unique(preg_split('/[\s,\.\n]+/', $purged));
        $allWords = [];
        foreach ($wordsRaw as $word) {
            if (mb_strlen($word, 'UTF-8') > 2 && mb_strlen($word, 'UTF-8') <= 255) {
                $allWords[] = $word;
            }
        }
        return $allWords;
    }
418818
public function tags()
    {
        $result = $this->execute('list', array('--xml' => true, $this->getUrl() . '/' . $this->basePaths['tags']));

        $tags = array();
        foreach ($result as $fileinfo) {
            $tags[] = new Reference($fileinfo->getFilename(), Reference::TAG, $fileinfo->getCommit()->getRevision());
        }

        return $tags;
    }
307488
public function metaKeywordString()
    {
        $tagKeywords = array_map(
        function( $tag )
            {
                /** @var eZTagsObject $tag */
                return $tag->attribute( 'keyword' );
            },
            $this->tags()
        );

        return !empty( $tagKeywords ) ? implode( ', ', $tagKeywords ) : '';
    }
569572
private function loadTagTokens(): array
    {
        $barrier = 0;
        $tokens = $this->docTagHelper->getTagTokens();

        $tokens = array_filter($tokens, function (array $token) use (&$barrier): bool {
            $allowed = true;

            if ($barrier) {
                if ($allowed = $token['column'] <= $barrier) {
                    $barrier = 0;
                }
            }

            if ($allowed && array_key_exists('contents', $token)) {
                $barrier = $token['column'];
            }

            return $allowed;
        });

        return $tokens;
    }
212000
public function getAllTagsText(): string
    {
        $examples = [];

        foreach (get_class_methods($this) as $method) {
            $reflection = new ReflectionMethod($this, $method);
            if ($reflection->isPublic() && !in_array($method, self::$public_but_not_allowed, true) && (string) $reflection->getReturnType() !== Builder::class) {
                $examples[$method] = $method;
            }
        }

        ksort($examples);

        return implode('<br>', $examples);
    }
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()];
    }
922158
protected function parseTag(): array
    {
        $return = [
            'status'  => false,
            'closing' => false,
            'node'    => null,
        ];
        if ($this->content->char() != '<') {
            // we are not at the beginning of a tag
            return $return;
        }

        // check if this is a closing tag
        if ($this->content->fastForward(1)->char() == '/') {
            // end tag
            $tag = $this->content->fastForward(1)
                                 ->copyByToken('slash', true);
            // move to end of tag
            $this->content->copyUntil('>');
            $this->content->fastForward(1);

            // check if this closing tag counts
            $tag = strtolower($tag);
            if (in_array($tag, $this->selfClosing)) {
                $return['status'] = true;

                return $return;
            } else {
                $return['status']  = true;
                $return['closing'] = true;
                $return['tag']     = strtolower($tag);
            }

            return $return;
        }

        $tag  = strtolower($this->content->copyByToken('slash', true));
        $node = new HtmlNode($tag);

        // attributes
        while ($this->content->char() != '>' &&
            $this->content->char() != '/') {
            $space = $this->content->skipByToken('blank', true);
            if (empty($space)) {
                $this->content->fastForward(1);
                continue;
            }

            $name = $this->content->copyByToken('equal', true);
            if ($name == '/') {
                break;
            }

            if (empty($name)) {
				$this->content->skipByToken('blank');
				continue;
            }

            $this->content->skipByToken('blank');
            if ($this->content->char() == '=') {
                $attr = [];
                $this->content->fastForward(1)
                              ->skipByToken('blank');
                switch ($this->content->char()) {
                    case '"':
                        $attr['doubleQuote'] = true;
                        $this->content->fastForward(1);
                        $string = $this->content->copyUntil('"', true, true);
                        do {
                            $moreString = $this->content->copyUntilUnless('"', '=>');
                            $string .= $moreString;
                        } while ( ! empty($moreString));
                        $attr['value'] = $string;
                        $this->content->fastForward(1);
                        $node->getTag()->$name = $attr;
                        break;
                    case "'":
                        $attr['doubleQuote'] = false;
                        $this->content->fastForward(1);
                        $string = $this->content->copyUntil("'", true, true);
                        do {
                            $moreString = $this->content->copyUntilUnless("'", '=>');
                            $string .= $moreString;
                        } while ( ! empty($moreString));
                        $attr['value'] = $string;
                        $this->content->fastForward(1);
                        $node->getTag()->$name = $attr;
                        break;
                    default:
                        $attr['doubleQuote']   = true;
                        $attr['value']         = $this->content->copyByToken('attr', true);
                        $node->getTag()->$name = $attr;
                        break;
                }
            } else {
                // no value attribute
                if ($this->options->strict) {
                    // can't have this in strict html
                    $character = $this->content->getPosition();
                    throw new StrictException("Tag '$tag' has an attribute '$name' with out a value! (character #$character)");
                }
                $node->getTag()->$name = [
                    'value'       => null,
                    'doubleQuote' => true,
                ];
                if ($this->content->char() != '>') {
                    $this->content->rewind(1);
                }
            }
        }

        $this->content->skipByToken('blank');
        if ($this->content->char() == '/') {
            // self closing tag
            $node->getTag()->selfClosing();
            $this->content->fastForward(1);
        } elseif (in_array($tag, $this->selfClosing)) {

            // Should be a self closing tag, check if we are strict
            if ($this->options->strict) {
                $character = $this->content->getPosition();
                throw new StrictException("Tag '$tag' is not self closing! (character #$character)");
            }

            // We force self closing on this tag.
            $node->getTag()->selfClosing();

            // Should this tag use a trailing slash?
            if(in_array($tag, $this->noSlash))
            {
                $node->getTag()->noTrailingSlash();
            }

        }

        $this->content->fastForward(1);

        $return['status'] = true;
        $return['node']   = $node;

        return $return;
    }
1008351
protected function getTagValues()
    {
        // Step1 Get tags value from cache
        $keys = array_map(array($this, 'getTagKey'), $this->tags);
        $values = $this->cache->getMulti($keys);

        // Step2 Initialize new tags value
        $emptyKeys = array_diff($values, array_filter($values));
        if ($emptyKeys) {
            $newValues = $this->setTagValues($emptyKeys);
            $values = array_merge($values, $newValues);
        }

        return $values;
    }
3209
private function removeOldTagLines(): array
    {
        $tags = $this->getTagTokens();
        $firstTag = array_shift($tags);

        (new LineHelper($this->file))
            ->removeLines(
                $firstTag['line'],
                $this->tokens[$this->token['comment_closer']]['line']
            );

        return $firstTag;
    }
1169337
public String[] getTags(String word) {
    if (caseSensitive) {
      return (String[]) dictionary.get(word);
    }
    else {
      //System.err.println(java.util.Arrays.asList((String[]) dictionary.get(word.toLowerCase())));
      return (String[]) dictionary.get(word.toLowerCase());
    }
  }
849777
public static function tags()
    {
        $args = func_get_args();
        $ret = NULL;
        foreach($args as $a)
        {
            $class = "";
            $id = "";
            $type = "";
            $text = "";
            
            if(isset($a['class']))
                $class = $a['class'];
            if(isset($a['id']))
                $id    = $a['id'];
            if(isset($a['type']))
                $type  = $a['type'];
            if(isset($a['text']))
                $text = $a['text'];
            
            unset($a['class'],$a['id'], $a['type'],$a['text']);
            
            $ret .= self::tag($type, $text, $class, $id, $a) . PHP_EOL;
            
        }
        
        return $ret;
    }
1031207
public function getTags()
    {
        return $this->hasMany(Tag::class, ['id' => 'tag_id'])->viaTable('{{%admin_tag_relation}}', ['pk_id' => 'id'], function ($query) {
            $query->andWhere(['table_name' => static::cleanBaseTableName(static::tableName())]);
        });
    }
940335
public function getTagList()
    {
        $string = '';
        foreach ($this->PublicTags() as $t) {
            $string .= Convert::raw2url($t->Name) . ' ';
        }
        return trim($string);
    }
1166908
protected function _getTagsAsString()
    {
        if (empty($this->_properties['tags'])) {
            return null;
        }

        return implode(', ', collection($this->_properties['tags'])->extract('tag')->toList());
    }
888417
protected static function prepare_content ($tag, $attributes) {
		$in = '';
		if (
			$tag == 'select' ||
			$tag == 'optgroup' ||
			$tag == 'datalist'
		) {
			$in = [
				'in' => $attributes['in']
			];
			if (isset($attributes['value'])) {
				$in['value'] = $attributes['value'];
			}
			unset($attributes['in'], $attributes['value']);
		} elseif (isset($attributes['in'])) {
			$in = $attributes['in'];
			unset($attributes['in']);
		}
		return [$in, $attributes];
	}
20445
protected function tagsFromRequest() {
		$tags = $this->owner->getRequest()->getVar('tags') ? $this->owner->getRequest()->getVar('tags') : '';

		if (strlen($tags)) {
			$tags = explode(',', $tags);
		} else {
			$tags = array();
		}
		
		return $tags;
	}
719911
public function getTagNameList()
    {
        $tags = $this->owner->Tags();
        $names = [];

        foreach ($tags as $tag) {
            $names[] = $tag->Name;
        }

        return implode(', ', $names);
    }