Package cc.mallet.util
Class DBInstanceStore
- java.lang.Object
-
- cc.mallet.util.DBInstanceStore
-
public class DBInstanceStore extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
EMPTY
static int
FEATURE_SEQUENCE
static int
FEATURE_VECTOR
static int
FEATURE_VECTOR_SEQUENCE
static int
LABEL
static int
STRING
-
Constructor Summary
Constructors Constructor Description DBInstanceStore(java.lang.String dbName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int[]
byteArrayToIntArray(byte[] src)
Convert an array of bytes to an array of integers by copying the bits directly.void
cleanup()
static byte[]
intArrayToByteArray(int[] src)
Convert an array of integers to an array of bytes by copying the bits of each int to four bytes.static void
main(java.lang.String[] args)
void
saveAlphabets(Alphabet dataAlphabet, Alphabet targetAlphabet)
void
saveInstances(java.util.Iterator<Instance> iterator)
-
-
-
Field Detail
-
EMPTY
public static final int EMPTY
- See Also:
- Constant Field Values
-
STRING
public static final int STRING
- See Also:
- Constant Field Values
-
FEATURE_VECTOR
public static final int FEATURE_VECTOR
- See Also:
- Constant Field Values
-
FEATURE_SEQUENCE
public static final int FEATURE_SEQUENCE
- See Also:
- Constant Field Values
-
FEATURE_VECTOR_SEQUENCE
public static final int FEATURE_VECTOR_SEQUENCE
- See Also:
- Constant Field Values
-
LABEL
public static final int LABEL
- See Also:
- Constant Field Values
-
-
Method Detail
-
intArrayToByteArray
public static byte[] intArrayToByteArray(int[] src)
Convert an array of integers to an array of bytes by copying the bits of each int to four bytes. Based on code at java2s.com.
-
byteArrayToIntArray
public static int[] byteArrayToIntArray(byte[] src)
Convert an array of bytes to an array of integers by copying the bits directly. Based on code at java2s.com.
-
saveAlphabets
public void saveAlphabets(Alphabet dataAlphabet, Alphabet targetAlphabet) throws java.lang.Exception
- Throws:
java.lang.Exception
-
saveInstances
public void saveInstances(java.util.Iterator<Instance> iterator) throws java.lang.Exception
- Throws:
java.lang.Exception
-
cleanup
public void cleanup() throws java.lang.Exception
- Throws:
java.lang.Exception
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-