contextFold.features
Class SinglePosContext
java.lang.Object
contextFold.features.FeatureExtractor
contextFold.features.ContextFeatureExtractor
contextFold.features.SinglePosContext
- All Implemented Interfaces:
- java.io.Serializable
public class SinglePosContext
- extends ContextFeatureExtractor
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
EMPTY_CONTEXT
public static final SinglePosContext EMPTY_CONTEXT
offsets
protected int[] offsets
alphabetIx
protected int alphabetIx
currWord
protected byte[] currWord
SinglePosContext
public SinglePosContext(int alphabet,
int... offsets)
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: