Used to fill input words collection
If $words is null, it would put an empty word collection

@param WordCollection|null $words
@return $this
969752
public function setInputWords($words = null)
    {
        if ($words === null) {
            $this->inputWords = new WordCollection();
        } else {
            $this->inputWords = $words;
        }

        return $this;
    }
1239425
public function create(
        $limit,
        $nameWords
    ) {
        $vocabularies = [];
        for ($i = 0; $i < $limit; $i++) {
            try {
                // Create a vocabulary.
                $vocabulary = $this->entityTypeManager->getStorage('taxonomy_vocabulary')->create(
                    [
                        'name' => $this->getRandom()->sentences(mt_rand(1, $nameWords), true),
                        'description' => $this->getRandom()->sentences(mt_rand(1, $nameWords)),
                        'vid' => Unicode::strtolower($this->getRandom()->name()),
                        'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
                        'weight' => mt_rand(0, 10),
                    ]
                );
                $vocabulary->save();
                $vocabularies['success'][] = [
                    'vid' => $vocabulary->id(),
                    'vocabulary' => $vocabulary->get('name'),
                ];
            } catch (\Exception $error) {
                $vocabularies['error'][] = $error->getMessage();
            }
        }

        return $vocabularies;
    }
498676
public function startsWith($word, $identical = false)
    {
        $this->addCondition(__METHOD__, [$word, $identical]);

        return $this;
    }
239053
public function reset($items = null)
    {
        $this->items = [];
        if ((func_get_args() > 0) && is_array($items)) {
            $this->items = $items;
        }
        return $this;
    }
536475
@Override
    public Collection<String> wordsNearest(INDArray words, int top) {
        return modelUtils.wordsNearest(words, top);
    }
608224
public function create(
        $vocabularies,
        $limit,
        $nameWords
    ) {
        $siteVocabularies = $this->drupalApi->getVocabularies();
        $terms = [];
        for ($i = 0; $i < $limit; $i++) {
            try {
                $vocabulary = $vocabularies[array_rand($vocabularies)];
                $term = $this->entityTypeManager->getStorage('taxonomy_term')->create(
                    [
                        'vid' => $vocabulary,
                        'name' => $this->getRandom()->sentences(mt_rand(1, $nameWords), true),
                        'description' => [
                            'value' => $this->getRandom()->sentences(mt_rand(1, $nameWords)),
                            'format' => 'full_html',
                        ],
                        'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
                    ]
                );
                $term->save();
                $terms['success'][] = [
                    'tid' => $term->id(),
                    'vocabulary' => $siteVocabularies[$vocabulary],
                    'name' => $term->getName(),
                ];
            } catch (\Exception $error) {
                $terms['error'][] = $error->getMessage();
            }
        }

        return $terms;
    }
682305
public Query setOptionalWords(List<String> words) {
    StringBuilder builder = new StringBuilder();
    for (String word : words) {
      builder.append(word);
      builder.append(",");
    }
    this.optionalWords = builder.toString();
    return this;
  }
773726
public function remove_word($word)
    {
        $this->load_dict();

        if (($key = array_search($word, $this->dict)) !== false) {
            unset($this->dict[$key]);
            $this->update_dict();
        }
    }
985140
public function setDefaultVocabulary(VocabularyInterface $vocabulary)
    {
        // If the new default vocabulary differs from the current one
        if ($this->defaultVocabulary !== $vocabulary) {
            $context = clone $this;
            $context->defaultVocabulary = $vocabulary;
            return $context;
        }

        return $this;
    }
709644
public function getWord(string $word)
    {
        if (isset($this->words[strtolower($word)])) {
            return new SpecialWord($word, $this->words[strtolower($word)][0], $this->words[strtolower($word)][1]);
        }

        return new Word($word);
    }
132336
public function setKeywords(array $keywords)
    {
        foreach ($keywords as $query) {
            $keyword    = $query[0];
            $properties = (isset($query[1]) ? (array)$query[1] : null);
            $this->addKeyword($keyword, $properties);
        }

        return $this;
    }
1230609
public function init($words = array())
    {
        if ($words)
        {
            $this->words = array();
            foreach ($words as $word) {
                $this->words[$this->prepare_word($word)] = $word;
            }
        }
        foreach ($this->words as $word)
        {
            $word = $this->prepare_word($word);
            $parts = $this->get_parts($word);

            $this->wordInfo[$word] = array("word" => $word, "num_parts" => count($parts));

            foreach ($parts as $part)
            {
                $size = mb_strlen($part);
                $skey = $size;
                if (!isset($this->wordParts[$skey]))
                {
                    $this->wordParts[$skey] = array();
                }
                if (!isset($this->wordParts[$skey][$part]))
                {
                    $this->wordParts[$skey][$part] = array("words" => array());
                }
                $this->wordParts[$skey][$part]["words"][$word] = $word;
            }
        }
        $this->isInitialized = true;
    }
614429
public function getWords(array $words)
    {
        $query = $this->dbHandler->createSelectQuery();

        // use array_map as some DBMS-es do not cast integers to strings by default
        $query->select('*')
            ->from('ezsearch_word')
            ->where($query->expr->in('word', array_map('strval', $words)));

        $stmt = $query->prepare();
        $stmt->execute();

        return $stmt->fetchAll(PDO::FETCH_ASSOC);
    }
499465
public void add(String word) {
		if (word.trim().length() > 0)
			m_Words.add(word.trim().toLowerCase());
	}
859147
public function addChildren(Collection $children)
    {
        foreach ($children as $child) {
                $this->addChild($child);
        }

        return $this;
    }
11646
public function addWord($word, $value = 1)
    {
        if (isset($this->wordsArray[$word])) {
            $this->wordsArray[$word] += $value;
        } else {
            $this->wordsArray[$word] = $value;
        }
    }
1336004
public function setKeywords($keywords)
    {
        if (!empty($keywords)) {
            Yii::$app->view->registerMetaTag(['name' => 'keywords', 'content' => $keywords], 'keywords');
        }
        return $this;
    }