public void consumeVocabulary(VocabularyHolder holder) { for (VocabularyWord word : holder.getVocabulary()) { if (!this.containsWord(word.getWord())) { this.addWord(word); } else { holder.incrementWordCounter(word.getWord()); } } }
public VocabularyHolder build() { VocabularyHolder holder = null; if (cache != null) { holder = new VocabularyHolder(cache, true); } else { holder = new VocabularyHolder(); } holder.minWordFrequency = this.minWordFrequency; holder.hugeModelExpected = this.hugeModelExpected; holder.scavengerThreshold = this.scavengerThreshold; holder.retentionDelay = this.retentionDelay; return holder; }