/* (non-Javadoc)
@see com.enigmastation.extractors.WordLister#addWords(java.lang.Object, java.util.Collection)
197858
@SuppressWarnings("unchecked")
	public void addWords(Object document, Collection<String> collection) {
		if (document instanceof Collection<?>){
			collection.addAll((Collection<String>)document);
		}else if (document instanceof AnalyzedText){
			collection.addAll(((AnalyzedText)document).getWords());
		}else {
			throw new IllegalArgumentException("Only instances of AnalyzedText can be handled.");
		}
	}
1008117
public void word (Color color, String... words) {
		for (String word : words) {
			addRule(new WordHighlightRule(color, word));
		}
	}
617697
public void add(IWord word)
    {
        //check and extends the entity from the base word
        if ( word.getEntity() == null ) {
            word.setEntity(rootWord.getEntity());
        }
        
        //check and extends the part of speech from the base word
        if ( word.getPartSpeech() == null ) {
            word.setPartSpeech(rootWord.getPartSpeech());
        }
        
        word.setSyn(this);
        synsList.add(word);
    }
124401
public PostBuilder withCategories(Term... terms) {
        return withCategories(Arrays.stream(terms).map(Term::getId).collect(toList()));
    }
1055329
private static void addKeyword(String text, int type) {
        KEYWORDS.add(text);
        addTranslation(text, type);
    }
618528
public void addTWord(String word, String tag){
		TWord tword = new TWord(word, tag);
		sentence.add(tword);
	}
603372
private static void replaceWords(StringBuilder input, String[] words, String[] replaces, boolean ignoreCase) {
        if (input == null || input.length()==0 || words == null ||
                words.length == 0 || replaces == null || replaces.length == 0) {
            return;
        }

        // the same number of word to replace and replaces to use
        if (words.length != replaces.length) {
            throw new IllegalArgumentException(String.format("Words (%d) and replaces (%d) lengths should be equals", words.length, replaces.length));
        }

        for(int i = 0; i < words.length; i++) {
            replaceWord(input, words[i], replaces[i], ignoreCase);
        }
    }
1370152
public boolean add( T word )
    {
        Entry<T> o = new Entry<T>(word, tail.prev, tail);
        tail.prev.next = o;
        tail.prev = o;
        
        //set the size and set the index
        size++;
        index.put(word.getValue(), word);
        
        return true;
    }
1331213
public function addWords(array $words)
    {
        $query = $this->dbHandler->createInsertQuery();
        $query->insertInto('ezsearch_word');

        $word = null;

        $query->set(
            'word',
            ':word'
        )->set(
            'object_count',
            '1'
        );
        $stmt = $query->prepare();
        foreach ($words as $word) {
            $stmt->execute(['word' => $word]);
        }
    }
1291916
protected void addContextTerms(SparseDoubleVector meaning,
                                   Queue<String> words,
                                   int distance) {
        // Iterate through the words in the context.
        for (String term : words) {
            if (!term.equals(IteratorFactory.EMPTY_TOKEN)) {

                // If in read only mode, ignore any terms that are not already in the
                // index map.
                if (readOnly && !indexMap.containsKey(term))
                    continue;

                // Get the index vector for the word.
                TernaryVector termVector = indexMap.get(term);
                if (termVector == null)
                    continue;
                
                // Permute the index vector if a permutation function is provided.
                if (permFunc != null)
                        termVector = permFunc.permute(termVector, distance);

                // Add the index vector and update the distance.
                add(meaning, termVector);
                ++distance;
            }
        }
    }
358283
public void
addAll(Mnemonic source) {
	if (wordcase != source.wordcase)
		throw new IllegalArgumentException(source.description +
						   ": wordcases do not match");
	strings.putAll(source.strings);
	values.putAll(source.values);
}
738926
public void importVocabulary(@NonNull VocabCache<T> vocabCache) {
        AtomicBoolean added = new AtomicBoolean(false);
        for (T element : vocabCache.vocabWords()) {
            if (this.addToken(element))
                added.set(true);
        }
        //logger.info("Current state: {}; Adding value: {}", this.documentsCounter.get(), vocabCache.totalNumberOfDocs());
        if (added.get())
            this.documentsCounter.addAndGet(vocabCache.totalNumberOfDocs());
    }
352322
public static Word combine(List<Word> words){
        if(words==null || words.size() < 2){
            return null;
        }
        String key = "";
        for(Word word : words){
            key += word.getText();
            key += " ";
        }
        key=key.trim();
        String value = GENERIC_TRIE.get(key);
        if(value==null){
            return null;
        }
        return new Word(value);
    }
874209
public void addKeywords(String[] keywords) {
        for (String keyword : keywords) {
            if (taxonomy.concepts.containsKey(keyword)) {
                throw new IllegalArgumentException(String.format("Concept %s already exists.", keyword));
            }
        }

        for (String keyword : keywords) {
            taxonomy.concepts.put(keyword, this);
        }

        if (synset == null) {
            synset = new TreeSet<>();
        }

        for (String keyword : keywords) {
            synset.add(keyword);
        }
    }
1212956
public void addWord(String word) {
		WordTree parent = null;
		WordTree current = this;
		WordTree child;
		char currentChar = 0;
		int length = word.length();
		for(int i = 0; i < length; i++){
			currentChar = word.charAt(i);
			if(false == StopChar.isStopChar(currentChar)){//只处理合法字符
				child = current.get(currentChar);
				if(child == null){
					//无子类，新建一个子节点后存放下一个字符
					child = new WordTree();
					current.put(currentChar, child);
				}
				parent = current;
				current = child;
			}
		}
		if(null != parent){
			parent.setEnd(currentChar);
		}
	}
1003134
public void addTerm(OntologyTerm term) {
        terms.put(term.getId(), term);
        indexTerm(term);
        isTypeOfIsBuilt = false;
    }
602742
List<String> wordList() {
        List<String> words = new ArrayList<>();

        if (userName != null) {
            words.add(userName);
        }

        if (name != null) {
            if (name.givenName != null) {
                words.add(name.givenName);
            }
            if (name.familyName != null) {
                words.add(name.familyName);
            }
            if (nickName != null) {
                words.add(nickName);
            }
        }

        if (emails != null) {
            for (Email email : emails) {
                words.add(email.getValue());
            }
        }

        return words;
    }