Sometimes a Trie's values aren't important, only the words matter.
Convenience method that associates each word with an empty value.

@param words Words to put in the Trie.
@return A Trie where each word is associated to an empty value.
436153
public static Trie<String> toStringTrie(List<String> words) {
        final TrieBuilder<String> builder = new TrieBuilder<>();
        for (String word : words) {
            builder.add(word, "");
        }
        return builder.build();
    }
301366
def words(total)
      if total.class == Range
        (1..interpret_value(total)).map { WORDS[random_number(total.min, total.max)] }.join(' ')
      else
        (1..interpret_value(total)).map { WORDS[random_number(0, total)] }.join(' ')
      end
    end
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;
    }
210653
public void addWords(String... words){
		HashSet<String> wordsSet = CollectionUtil.newHashSet(words);
		for (String word : wordsSet) {
			addWord(word);
		}
	}
430825
public ArrayList<String> findReplacements(String word) {
    final List<CandidateData> result = findReplacementCandidates(word);

    final ArrayList<String> resultSuggestions = new ArrayList<String>(result.size());
    for (CandidateData cd : result) {
      resultSuggestions.add(cd.getWord());
    }
    return resultSuggestions;
  }
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;
  }
75750
public void puts(String words) {
    if (mode.isWritable() == false)
      throw new IllegalStateException("IOError: not opened for writing");

    try {
      raFile.write(words.getBytes());
      raFile.writeBytes(System.getProperty("line.separator"));
    } catch (IOException e) {
      logger.log(Level.SEVERE, null, e);
      throw new RuntimeException(e);
    }
  }
391617
public String capitalize( String words ) {
        if (words == null) return null;
        String result = words.trim();
        if (result.length() == 0) return "";
        if (result.length() == 1) return result.toUpperCase();
        return "" + Character.toUpperCase(result.charAt(0)) + result.substring(1).toLowerCase();
    }
1100637
public List<CoNLLWord> findChildren(CoNLLWord word)
    {
        List<CoNLLWord> result = new LinkedList<CoNLLWord>();
        for (CoNLLWord other : this)
        {
            if (other.HEAD == word)
                result.add(other);
        }
        return result;
    }
671705
public Sentence makeSentence(String[] words, String[] posTags, boolean rootFirst, boolean lowerCased)
    {
        ArrayList<Integer> tokens = new ArrayList<Integer>();
        ArrayList<Integer> tags = new ArrayList<Integer>();
        ArrayList<Integer> bc4 = new ArrayList<Integer>();
        ArrayList<Integer> bc6 = new ArrayList<Integer>();
        ArrayList<Integer> bcf = new ArrayList<Integer>();

        int i = 0;
        for (String word : words)
        {
            if (word.length() == 0)
                continue;
            String lowerCaseWord = word.toLowerCase();
            if (lowerCased)
                word = lowerCaseWord;

            int[] clusterIDs = clusterId(word);
            bcf.add(clusterIDs[0]);
            bc4.add(clusterIDs[1]);
            bc6.add(clusterIDs[2]);

            String pos = posTags[i];

            int wi = -1;
            if (wordId.containsKey(word))
                wi = wordId.get(word);

            int pi = -1;
            if (wordId.containsKey(pos))
                pi = wordId.get(pos);

            tokens.add(wi);
            tags.add(pi);

            i++;
        }

        if (!rootFirst)
        {
            tokens.add(0);
            tags.add(0);
            bcf.add(0);
            bc6.add(0);
            bc4.add(0);
        }

        return new Sentence(tokens, tags, bc4, bc6, bcf);
    }
953612
public static void append(String key, String[] words) {

        SmartForest<List<String>> synonyms = get(key);

        Set<String> set = new HashSet<>();

        for (String word : words) {
            if (StringUtil.isBlank(word)) {
                continue;
            }
            set.add(word);
        }

        if (set.size() <= 1) {
            LOG.warn(Arrays.toString(words) + " not have any change because it less than 2 word");
            return;
        }

        set.addAll(findAllWords(key, words));

        List<String> list = new ArrayList<>(set);

        for (String word : list) {
            synonyms.addBranch(word, list);
        }
    }
1294327
public static boolean add(String word)
    {
        if (HanLP.Config.Normalization) word = CharTable.convert(word);
        if (contains(word)) return false;
        return insert(word, null);
    }
1201144
public static float trigram(List<Word> words){
        if(words.size() > 2){
            float score=0;
            for(int i=0; i<words.size()-2; i++){
                score += Trigram.getScore(words.get(i).getText(), words.get(i+1).getText(), words.get(i+2).getText());
            }
            return score;
        }
        return 0;
    }
986759
public static List<Word> refine(List<Word> words){
        if(LOGGER.isDebugEnabled()) {
            LOGGER.debug("对分词结果进行refine之前：{}", words);
        }
        List<Word> result = new ArrayList<>(words.size());
        //一：拆词
        for(Word word : words){
            List<Word> splitWords = WordRefiner.split(word);
            if(splitWords==null){
                result.add(word);
            }else{
                if(LOGGER.isDebugEnabled()) {
                    LOGGER.debug("词： " + word.getText() + " 被拆分为：" + splitWords);
                }
                result.addAll(splitWords);
            }
        }
        if(LOGGER.isDebugEnabled()) {
            LOGGER.debug("对分词结果进行refine阶段的拆词之后：{}", result);
        }
        //二：组词
        if(result.size()<2){
            return result;
        }
        int combineMaxLength = WordConfTools.getInt("word.refine.combine.max.length", 3);
        if(combineMaxLength < 2){
            combineMaxLength = 2;
        }
        List<Word> finalResult = new ArrayList<>(result.size());
        for(int i=0; i<result.size(); i++){
            List<Word> toCombineWords = null;
            Word combinedWord = null;
            for(int j=2; j<=combineMaxLength; j++){
                int to = i+j;
                if(to > result.size()){
                    to = result.size();
                }
                toCombineWords = result.subList(i, to);
                combinedWord = WordRefiner.combine(toCombineWords);
                if(combinedWord != null){
                    i += j;
                    i--;
                    break;
                }
            }
            if(combinedWord == null){
                finalResult.add(result.get(i));
            }else{
                if(LOGGER.isDebugEnabled()) {
                    LOGGER.debug("词： " + toCombineWords + " 被合并为：" + combinedWord);
                }
                finalResult.add(combinedWord);
            }
        }
        if(LOGGER.isDebugEnabled()) {
            LOGGER.debug("对分词结果进行refine阶段的组词之后：{}", finalResult);
        }
        return finalResult;
    }
174764
public static float bigram(List<Word> words){
        if(words.size() > 1){
            float score=0;
            for(int i=0; i<words.size()-1; i++){
                score += getScore(words.get(i).getText(), words.get(i+1).getText());
            }
            return score;
        }
        return 0;
    }
941839
@Override
    public Collection<String> wordsNearest(INDArray words, int top) {
        Counter<String> distances = new Counter<>();

        for (String s : vocabCache.words()) {
            INDArray otherVec = lookupTable.vector(s);
            double sim = Transforms.cosineSim(Transforms.unitVec(words.dup()), Transforms.unitVec(otherVec.dup()));
            distances.incrementCount(s, (float) sim);
        }

        distances.keepTopNElements(top);
        return distances.keySetSorted();
    }
175428
@Override
    public Collection<String> wordsNearestSum(String word, int n) {
        //INDArray vec = Transforms.unitVec(this.lookupTable.vector(word));
        INDArray vec = this.lookupTable.vector(word);
        return wordsNearestSum(vec, n);
    }