@Test public void testTransferBackToVocabCache() throws Exception { VocabularyHolder holder = new VocabularyHolder(); holder.addWord("test"); holder.addWord("tests"); holder.addWord("testz"); holder.incrementWordCounter("tests"); holder.incrementWordCounter("tests"); holder.incrementWordCounter("testz"); InMemoryLookupCache cache = new InMemoryLookupCache(false); holder.updateHuffmanCodes(); holder.transferBackToVocabCache(cache); assertEquals(3, cache.numWords()); assertEquals(1, cache.wordFrequency("test")); assertEquals(2, cache.wordFrequency("testz")); assertEquals(3, cache.wordFrequency("tests")); assertEquals("tests", cache.wordAtIndex(0)); assertEquals("testz", cache.wordAtIndex(1)); assertEquals("test", cache.wordAtIndex(2)); }
public void transferBackToVocabCache() { transferBackToVocabCache(this.vocabCache, true); }
VocabularyHolder implements Serializable { public void transferBackToVocabCache() { transferBackToVocabCache(this.vocabCache, true); } }
VocabularyHolder implements Serializable { public void transferBackToVocabCache() { transferBackToVocabCache(this.vocabCache, true); } protected  VocabularyHolder(); protected  VocabularyHolder(@NonNull VocabCache<? extends SequenceElement> cache, boolean markAsSpecial); }
VocabularyHolder implements Serializable { public void transferBackToVocabCache() { transferBackToVocabCache(this.vocabCache, true); } protected  VocabularyHolder(); protected  VocabularyHolder(@NonNull VocabCache<? extends SequenceElement> cache, boolean markAsSpecial); static HuffmanNode buildNode(List<Byte> codes, List<Integer> points, int codeLen, int index); void transferBackToVocabCache(); void transferBackToVocabCache(VocabCache cache); void transferBackToVocabCache(VocabCache cache, boolean emptyHolder); static List<Byte> arrayToList(byte[] array, int codeLen); static byte[] listToArray(List<Byte> code); static int[] listToArray(List<Integer> points, int codeLen); static List<Integer> arrayToList(int[] array, int codeLen); Collection<VocabularyWord> getVocabulary(); VocabularyWord getVocabularyWordByString(String word); VocabularyWord getVocabularyWordByIdx(Integer id); boolean containsWord(String word); void incrementWordCounter(String word); void addWord(String word); void addWord(VocabularyWord word); void consumeVocabulary(VocabularyHolder holder); void resetWordCounters(); int numWords(); void truncateVocabulary(); void truncateVocabulary(int threshold); List<VocabularyWord> updateHuffmanCodes(); int indexOf(String word); List<VocabularyWord> words(); long totalWordsBeyondLimit(); }
VocabularyHolder implements Serializable { public void transferBackToVocabCache() { transferBackToVocabCache(this.vocabCache, true); } protected  VocabularyHolder(); protected  VocabularyHolder(@NonNull VocabCache<? extends SequenceElement> cache, boolean markAsSpecial); static HuffmanNode buildNode(List<Byte> codes, List<Integer> points, int codeLen, int index); void transferBackToVocabCache(); void transferBackToVocabCache(VocabCache cache); void transferBackToVocabCache(VocabCache cache, boolean emptyHolder); static List<Byte> arrayToList(byte[] array, int codeLen); static byte[] listToArray(List<Byte> code); static int[] listToArray(List<Integer> points, int codeLen); static List<Integer> arrayToList(int[] array, int codeLen); Collection<VocabularyWord> getVocabulary(); VocabularyWord getVocabularyWordByString(String word); VocabularyWord getVocabularyWordByIdx(Integer id); boolean containsWord(String word); void incrementWordCounter(String word); void addWord(String word); void addWord(VocabularyWord word); void consumeVocabulary(VocabularyHolder holder); void resetWordCounters(); int numWords(); void truncateVocabulary(); void truncateVocabulary(int threshold); List<VocabularyWord> updateHuffmanCodes(); int indexOf(String word); List<VocabularyWord> words(); long totalWordsBeyondLimit();  }