Adds new tag words.
@param string[] $allWords All words extracted from post
@throws Exception
499
protected function addNewWords($allWords)
    {
        try {
            $newWords = $allWords;
            $query = (new Query())->from(Vocabulary::tableName())->where(['word' => $allWords]);
            foreach ($query->each() as $vocabularyFound) {
                if (($key = array_search($vocabularyFound['word'], $allWords)) !== false) {
                    unset($newWords[$key]);
                }
            }
            $formatWords = [];
            foreach ($newWords as $word) {
                $formatWords[] = [$word];
            }
            if (!empty($formatWords)) {
                if (!Podium::getInstance()->db->createCommand()->batchInsert(
                        Vocabulary::tableName(), ['word'], $formatWords
                    )->execute()) {
                    throw new Exception('Words saving error!');
                }
            }
        } catch (Exception $e) {
            Log::error($e->getMessage(), null, __METHOD__);
            throw $e;
        }
    }
1368921
public function addTags(): void
    {
        $tags = $this->getTags();
        $currentStructureUuid = $this->getCurrentStructureUuid();
        if ($currentStructureUuid && !in_array($currentStructureUuid, $tags)) {
            $tags[] = $currentStructureUuid;
        }

        if (count($tags) <= 0) {
            return;
        }

        $this->symfonyResponseTagger->addTags($tags);
    }
901060
protected void addTagging(boolean seen, IntTaggedWord itw, double count) {
    if (seen) {
      seenCounter.incrementCount(itw, count);
      if (itw.tag() == nullTag) {
        words.add(itw);
      } else if (itw.word() == nullWord) {
        tags.add(itw);
      } else {
        // rules.add(itw);
      }
    } else {
      uwModel.addTagging(seen, itw, count);
      // if (itw.tag() == nullTag) {
      // sigs.add(itw);
      // }
    }
  }
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;
    }
389122
def _add_tags(self, tags):
        # type: (List[str]) -> bool
        
        alltagsadded = True
        for tag in tags:
            if not self._add_tag(tag):
                alltagsadded = False
        return alltagsadded
969752
public function setInputWords($words = null)
    {
        if ($words === null) {
            $this->inputWords = new WordCollection();
        } else {
            $this->inputWords = $words;
        }

        return $this;
    }
1302484
public function addTags(array $tags)
    {
        $this->tagsChanges['added'] = array_unique(
            array_merge($this->tagsChanges['added'], $tags)
        );

        return $this;
    }
888984
protected void addWord(List<Word> result, String text, int start, int len){
        Word word = getWord(text, start, len);
        if(word != null){
            result.add(word);
        }
    }
349259
def add(self, word):
        """"""
        if not word or word.strip() == '':
            return
        self.words[word]=word
99011
public static function addTags(array $tags)
    {
        if (count($tags) === 0)
            return;

        $found = Tag::whereIn('tag', $tags)->pluck('tag')->all();

        foreach (array_diff($tags, $found) as $tag) {
            if (empty(trim($tag)) || strlen($tag) < 3)
                continue;

            try {
                $model = new Tag;
                $model->tag = trim($tag);
                $model->save();
            } catch (\Illuminate\Database\QueryException $e) {
                $context = [];
                $context['file'] = $e->getFile() ?: '';
                $context['line'] = $e->getLine() ?: '';
                $context['code'] = $e->getCode() ?: '';

                logger()->warning($e->getMessage(), $context);
            }
        }
    }
943118
public void addTerm(NewWord newWord) {
        NewWord temp = null;
        SmartForest<NewWord> smartForest = null;
        if ((smartForest = sf.getBranch(newWord.getName())) != null && smartForest.getParam() != null) {
            temp = smartForest.getParam();
            temp.update(newWord.getNature(), newWord.getAllFreq());
        } else {
            count++;
            if (splitWord == null) {
                newWord.setScore(-1);
            } else {
                newWord.setScore(-splitWord.cohesion(newWord.getName()));
            }

            synchronized (sf) {
                sf.add(newWord.getName(), newWord);
            }
        }
    }
739125
public function add_word($word)
    {
        $this->load_dict();

        foreach (explode(' ', $word) as $word) {
            // sanity check
            if (strlen($word) < 512) {
                $this->dict[] = $word;
                $valid = true;
            }
        }

        if ($valid) {
            $this->dict = array_unique($this->dict);
            $this->update_dict();
        }
    }
592472
function addMagicWordsByLang( $newWords ) {
		$code = $this->getCode();
		$fallbackChain = array();
		while ( $code && !in_array( $code, $fallbackChain ) ) {
			$fallbackChain[] = $code;
			$code = self::getFallbackFor( $code );
		}
		if ( !in_array( 'en', $fallbackChain ) ) {
			$fallbackChain[] = 'en';
		}
		$fallbackChain = array_reverse( $fallbackChain );
		foreach ( $fallbackChain as $code ) {
			if ( isset( $newWords[$code] ) ) {
				$this->mMagicExtensions = $newWords[$code] + $this->mMagicExtensions;
			}
		}
	}
404085
public function withAddedKeywords(array $keywords = []) : self
    {
        $existing = array_map('trim', explode(',', $this->getAttribute('content') ?: ''));
        $new = array_merge($existing, $keywords);

        return $this->withAttribute('content', implode(', ', $new));
    }
1166433
@Override
  protected void addProhibitedWords(List<String> words) {
    if(words.size() == 1 && words.get(0).endsWith(".*")) {
      wordStartsToBeProhibited.add(words.get(0).substring(0, words.get(0).length()-2));
    } else {
      super.addProhibitedWords(words);
    }
  }
393448
public function addStopWords($list) {
		$this->data = array_unique(array_merge($this->data, (array)$list));
		return $this;
    }
1318611
protected function setIgnoreTags()
    {
        if (!count($this->ignore_tags)) {
            $this->ignore_tags = array_keys($this->parser->tags->all());
        }
    }