コード例 #1
0
 @Override
 public void importVocabulary(VocabCache<VocabWord> vocabCache) {
   for (VocabWord word : vocabCache.vocabWords()) {
     if (vocabs.containsKey(word.getLabel())) {
       wordFrequencies.incrementCount(word.getLabel(), word.getElementFrequency());
     } else {
       tokens.put(word.getLabel(), word);
       vocabs.put(word.getLabel(), word);
       wordFrequencies.incrementCount(word.getLabel(), word.getElementFrequency());
     }
     totalWordOccurrences.addAndGet((long) word.getElementFrequency());
   }
 }
コード例 #2
0
 @Override
 public void removeElement(VocabWord element) {
   removeElement(element.getLabel());
 }
コード例 #3
0
 @Override
 public synchronized void addToken(VocabWord word) {
   tokens.put(word.getLabel(), word);
 }