Class CompressibleProbBackoffValueContainer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int defaultValRank  
      protected long[] numNgramsForEachOrder  
      protected boolean storeSuffixIndexes  
      protected int[] suffixBitsForOrder  
      protected boolean useMapValueArray  
      protected VariableLengthBitCompressor valueCoder  
      protected int valueRadix  
      protected CustomWidthArray[] valueRanks  
      protected int valueWidth  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(int[] ngram, int startPos, int endPos, int ngramOrder, long offset, long prefixOffset, int word, V val_, long suffixOffset, boolean ngramIsNew)
      Adds a new value at the specified offset.
      void clearStorageAfterCompression​(int ngramOrder)  
      void clearStorageForOrder​(int ngramOrder)  
      CompressibleProbBackoffValueContainer createFreshValues​(long[] numNgramsForEachOrder_)
      Creates a fresh value container for copying purposes.
      void decompress​(BitStream bits, int ngramOrder, boolean justConsume, ProbBackoffPair outputVal)
      Reads and decompresses from the bit stream bits.
      float getBackoff​(int ngramOrder, long index)  
      float getBackoff​(CustomWidthArray valueRanksForNgramOrder, long index)  
      BitList getCompressed​(long offset, int ngramOrder)
      Compresses the value at the given offset into a list of bits.
      protected long getCountRank​(long val)  
      protected ProbBackoffPair getDefaultVal()  
      void getFromOffset​(long index, int ngramOrder, ProbBackoffPair outputVal)
      Gets the value living at a particular offset.
      protected void getFromRank​(long rank, ProbBackoffPair outputVal)  
      long getInternalVal​(int ngramOrder, long index)  
      float getProb​(int ngramOrder, long index)  
      float getProb​(CustomWidthArray valueRanksForOrder, long index)  
      protected long getRank​(int ngramOrder, long offset)  
      ProbBackoffPair getScratchValue()
      Creates a fresh value of object (useful for passing as an output parameter)
      long getSuffixOffset​(long index, int ngramOrder)  
      protected int getSuffixOffsetFromInternalVal​(long internalVal)  
      int numValueBits​(int ngramOrder)  
      void setFromOtherValues​(ValueContainer<ProbBackoffPair> o)
      Destructively sets internal storage from another object.
      void setMap​(NgramMap<V> map)
      Initializes a value container with the map that contains it
      void setSizeAtLeast​(long size, int ngramOrder)
      Sets internal storage for size for a particular n-gram order
      boolean storeSuffixoffsets()  
      void swap​(long a, long b, int ngramOrder)
      Swaps values at offsets a and b.
      void trim()
      Final clean up of storage.
      void trimAfterNgram​(int ngramOrder, long size)
      Clear storage after an n-gram order is complete
      protected boolean useValueStoringArray()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait