Sets the list of keywords, you can send an array or string separated with commas
also clears the previously set keywords

@param string|array $keywords

@return MetaTagsContract
162290
public function setKeywords($keywords)
    {

        if (!is_array($keywords)):
            $keywords = explode(', ', $this->keywords);
        endif;

        // clean keywords
        $keywords = array_map('strip_tags', $keywords);

        // store keywords
        $this->keywords = $keywords;

        return $this;
    }
1357605
public boolean addKeywords(String keywords) {
        try {
            return add(new Meta(Element.KEYWORDS, keywords));
		} catch (DocumentException de) {
            throw new ExceptionConverter(de);
        }
    }
237898
public function addKeyword($keyword, array $properties = null)
    {
        if ($properties === null) {
            $properties = [];
        }

        foreach ($properties as $propertyIdent) {
            $val = ('%'.$keyword.'%');
            $this->addFilter([
                'property' => $propertyIdent,
                'operator' => 'LIKE',
                'value'    => $val,
                'operand'  => 'OR'
            ]);
        }

        return $this;
    }
1373301
public function set_tags($tags) {
        $this->tags = [];
        foreach ($tags as $tag) {
            // We use $tag->id as the key for the array so not only it handles duplicates of the same tag being given,
            // but also it is consistent with the behaviour of set_tags_by_id() below.
            $this->tags[$tag->id] = $tag;
        }
    }
427950
public function addToLastSearches($keywords)
    {
        $mode = $this->configuration->getSearchLastSearchesMode();
        switch ($mode) {
            case 'user':
                $this->storeKeywordsToSession($keywords);
                break;
            case 'global':
                $this->lastSearchesRepository->add($keywords, (int)$this->configuration->getSearchLastSearchesLimit());
                break;
            default:
                throw new \UnexpectedValueException(
                    'Unknown mode for plugin.tx_solr.search.lastSearches.mode, valid modes are "user" or "global".',
                    1342456570
                );
        }
    }
445216
def set_keywords(self, keywords):
        """"""
        self.head.keywords.attr(content=", ".join(keywords))
        return self
894424
public function add_keyword($key, $word) {
        if (!is_array($this->language_data['KEYWORDS'][$key])) {
            $this->language_data['KEYWORDS'][$key] = array();
        }
        if (!in_array($word, $this->language_data['KEYWORDS'][$key])) {
            $this->language_data['KEYWORDS'][$key][] = $word;

            //NEW in 1.0.8 don't recompile the whole optimized regexp, simply append it
            if ($this->parse_cache_built) {
                $subkey = count($this->language_data['CACHED_KEYWORD_LISTS'][$key]) - 1;
                $this->language_data['CACHED_KEYWORD_LISTS'][$key][$subkey] .= '|' . preg_quote($word, '/');
            }
        }
    }
563378
protected function _prepareMetaKeyword($keywords, $removeDuplicatedWords = true)
    {
        $keywords = '';
        if (($activeCategory = $this->getActiveCategory())) {
            $keywordsList = [];

            if ($categoryTree = $this->getCategoryTree()) {
                foreach ($categoryTree->getPath() as $category) {
                    $keywordsList[] = trim($category->oxcategories__oxtitle->value);
                }
            }

            $subCategories = $activeCategory->getSubCats();
            if (is_array($subCategories)) {
                foreach ($subCategories as $subCategory) {
                    $keywordsList[] = $subCategory->oxcategories__oxtitle->value;
                }
            }

            if (count($keywordsList) > 0) {
                $keywords = implode(", ", $keywordsList);
            }
        }

        $keywords = parent::_prepareMetaDescription($keywords, -1, $removeDuplicatedWords);

        return trim($keywords);
    }
393171
public function keywordList($keyword)
    {
        $this->assertKeywords();

        if (isset($this->keywords[$keyword])) {
            return $this->keywords[$keyword];
        } else {
            return [];
        }
    }
1004924
private function prepareKeywords($keywords)
    {
        if ($keywords === null)
            return null;

        if (is_array($keywords))
            $keywords = implode(', ', $keywords);

        return strtolower(strip_tags($keywords));
    }
1047871
public function setKeyCodes($keyCodes) {
        if (!is_array($keyCodes)) {
            $keyCodes = array($keyCodes);
        }
        $this->keyCodes = $keyCodes;
        return $this;
    }
591201
public function validateCollection(array $keywords, array $options = [])
    {
        $errors = [];

        $maxScore = -1;
        $keywordsData = []; // We will store text and caseSensitive to check there is no duplicate

        foreach ($keywords as $index => $keyword) {
            // Validate keyword
            $errors = array_merge($errors, $this->validateAfterSchema($keyword, $options));

            if (empty($errors)) {
                if ($keyword['score'] > $maxScore) {
                    $maxScore = $keyword['score'];
                }

                // Checks for duplicates
                if (isset($keywordsData[$keyword['text']]) && in_array($keyword['caseSensitive'], $keywordsData[$keyword['text']], true)) {
                    // Keywords already exists
                    $caseSensitive = $keyword['caseSensitive'] ? 'true' : 'false'; // Converts to string to display in logs
                    $errors[] = [
                        'path' => "/{$index}",
                        'message' => "there is already a keyword with text: '{$keyword['text']}' and caseSensitive: '{$caseSensitive}'",
                    ];
                } else {
                    $keywordsData[$keyword['text']] = [];
                    $keywordsData[$keyword['text']][] = $keyword['caseSensitive'];
                }
            }
        }

        // check there is a keyword with a positive score
        if (in_array(Validation::VALIDATE_SCORE, $options) && $maxScore <= 0) {
            $errors[] = [
                'path' => '',
                'message' => 'there is no keyword with a positive score',
            ];
        }

        return $errors;
    }
819195
public function tags($tags = null)
    {
        $this->cacheTags = $tags === false ? false : $tags;
        return $this;
    }
1299630
public function set(array $tags)
    {
        if (!empty($tags)) {
            foreach ($tags as $_tag) {
                if (is_array($_tag) && isset($_tag['name']) && isset($_tag['content'])) {
                    $this->add(
                        $_tag['name'],
                        $_tag['content'],
                        isset($_tag['http-equiv']) && true===$_tag['http-equiv'] ? true : false,
                        isset($_tag['condition']) ? $_tag['condition'] : null
                    );
                }
            }
        }
        return $this;
    }
917513
protected function processMetaTags(array &$tags)
    {
        // Call hook
        GeneralUtility::callHookAndSignal(__CLASS__, 'metatagOutput', $this, $tags);

        // Add marker
        $markerList = array(
            '%YEAR%' => date('Y'),
        );

        $keyList = array(
            'meta.title',
            'meta.description',
            'meta.description.dc',
            'meta.keywords',
            'meta.keywords.dc',
            'meta.copyright',
            'meta.copyright.dc',
            'meta.publisher.dc',
        );

        foreach ($keyList as $key) {
            if (!empty($tags[$key]['attributes'])) {
                foreach ($markerList as $marker => $value) {
                    foreach ($tags[$key]['attributes'] as &$metaTagAttribute) {
                        // only replace markers if they are present
                        if (strpos($metaTagAttribute, $marker) !== false) {
                            $metaTagAttribute = str_replace($marker, $value, $metaTagAttribute);
                        }
                    }
                    unset($metaTagAttribute);
                }
            }
        }
    }
1255087
protected function createIsolatedDiffTagPlaceholders(&$words)
    {
        $openIsolatedDiffTags = 0;
        $isolatedDiffTagIndices = array();
        $isolatedDiffTagStart = 0;
        $currentIsolatedDiffTag = null;
        foreach ($words as $index => $word) {
            $openIsolatedDiffTag = $this->isOpeningIsolatedDiffTag($word, $currentIsolatedDiffTag);
            if ($openIsolatedDiffTag) {
                if ($this->isSelfClosingTag($word) || $this->stringUtil->stripos($word, '<img') !== false) {
                    if ($openIsolatedDiffTags === 0) {
                        $isolatedDiffTagIndices[] = array(
                            'start' => $index,
                            'length' => 1,
                            'tagType' => $openIsolatedDiffTag,
                        );
                        $currentIsolatedDiffTag = null;
                    }
                } else {
                    if ($openIsolatedDiffTags === 0) {
                        $isolatedDiffTagStart = $index;
                    }
                    ++$openIsolatedDiffTags;
                    $currentIsolatedDiffTag = $openIsolatedDiffTag;
                }
            } elseif ($openIsolatedDiffTags > 0 && $this->isClosingIsolatedDiffTag($word, $currentIsolatedDiffTag)) {
                --$openIsolatedDiffTags;
                if ($openIsolatedDiffTags == 0) {
                    $isolatedDiffTagIndices[] = array('start' => $isolatedDiffTagStart, 'length' => $index - $isolatedDiffTagStart + 1, 'tagType' => $currentIsolatedDiffTag);
                    $currentIsolatedDiffTag = null;
                }
            }
        }
        $isolatedDiffTagScript = array();
        $offset = 0;
        foreach ($isolatedDiffTagIndices as $isolatedDiffTagIndex) {
            $start = $isolatedDiffTagIndex['start'] - $offset;
            $placeholderString = $this->config->getIsolatedDiffTagPlaceholder($isolatedDiffTagIndex['tagType']);
            $isolatedDiffTagScript[$start] = array_splice($words, $start, $isolatedDiffTagIndex['length'], $placeholderString);
            $offset += $isolatedDiffTagIndex['length'] - 1;
        }

        return $isolatedDiffTagScript;
    }
246771
public function setKeywords($keywords)
    {
        if (!is_string($keywords))
        {
            throw Eresus_Exception_InvalidArgumentType::factory(__METHOD__, 1, 'string', $keywords);
        }
        $this->keywords = $keywords;
    }