contextFold.features
Class SinglePosContext

java.lang.Object
  extended by contextFold.features.FeatureExtractor
      extended by contextFold.features.ContextFeatureExtractor
          extended by contextFold.features.SinglePosContext
All Implemented Interfaces:
java.io.Serializable

public class SinglePosContext
extends ContextFeatureExtractor

See Also:
Serialized Form

Field Summary
protected  int alphabetIx
           
protected  byte[] currWord
           
static SinglePosContext EMPTY_CONTEXT
           
protected  int[] offsets
           
 
Fields inherited from class contextFold.features.ContextFeatureExtractor
length, reversedContext
 
Fields inherited from class contextFold.features.FeatureExtractor
cardinality, currProcessedSeq, FEATURE_1_EXTRACTOR, seqFeatures
 
Constructor Summary
SinglePosContext(int alphabet, int... offsets)
           
 
Method Summary
static byte calcAlphabetSize(byte[] alphabetMap)
           
static boolean contains(int[] offsets1, int[] offsets2)
           
 int getEffectiveCardinality()
           
 int getFeature(byte[] seq, int val)
           
 java.lang.String getFeatureName(int featureIx)
           
 java.lang.Integer[][] getFeaturesMap(ContextFeatureExtractor specificContext)
           
 int[] getOffsets()
           
 ContextFeatureExtractor getSuperContext(ContextFeatureExtractor other)
           
 SinglePosContext getSuperContext(SinglePosContext other)
           
 void preprocess(byte[] seq)
           
static int[] superOffsets(int[] offsets1, int[] offsets2)
           
 java.lang.String toString()
           
 
Methods inherited from class contextFold.features.ContextFeatureExtractor
contained, getLength, getReversedContext
 
Methods inherited from class contextFold.features.FeatureExtractor
getCardinality, getFeature, getFeatures, setSequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_CONTEXT

public static final SinglePosContext EMPTY_CONTEXT

offsets

protected int[] offsets

alphabetIx

protected int alphabetIx

currWord

protected byte[] currWord
Constructor Detail

SinglePosContext

public SinglePosContext(int alphabet,
                        int... offsets)
Method Detail

getFeaturesMap

public java.lang.Integer[][] getFeaturesMap(ContextFeatureExtractor specificContext)
Specified by:
getFeaturesMap in class ContextFeatureExtractor

getOffsets

public int[] getOffsets()

preprocess

public void preprocess(byte[] seq)
Specified by:
preprocess in class FeatureExtractor

getFeature

public int getFeature(byte[] seq,
                      int val)
Specified by:
getFeature in class FeatureExtractor

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

calcAlphabetSize

public static byte calcAlphabetSize(byte[] alphabetMap)

getEffectiveCardinality

public int getEffectiveCardinality()
Overrides:
getEffectiveCardinality in class FeatureExtractor

getFeatureName

public java.lang.String getFeatureName(int featureIx)
Overrides:
getFeatureName in class FeatureExtractor

getSuperContext

public SinglePosContext getSuperContext(SinglePosContext other)

superOffsets

public static int[] superOffsets(int[] offsets1,
                                 int[] offsets2)

contains

public static boolean contains(int[] offsets1,
                               int[] offsets2)

getSuperContext

public ContextFeatureExtractor getSuperContext(ContextFeatureExtractor other)
Specified by:
getSuperContext in class ContextFeatureExtractor
Returns: