|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--mark.nlp.data.Instance
|
+--mark.nlp.data.SparseBagInstance
An instance that is also a bag of objects.
| Constructor Summary | |
SparseBagInstance(int category,
SparseBag bag)
Initializes the instance. |
|
SparseBagInstance(TokenInstance tokenInstance,
ObjectMap vocabulary)
Initializes the sparse bag instance. |
|
| Method Summary | |
SparseBag |
bag()
Returns the instance's bag. |
java.util.Iterator |
iterator()
Returns an iterator over the object types. |
double |
num()
Returns the number of object occurrences in the bag. |
double |
num(java.lang.Object o)
Returns the number of object type o occurrences in the bag. |
int |
numTypes()
Returns the number of object types with non-zero occurrences. |
| Methods inherited from class mark.nlp.data.Instance |
category, setCategory |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SparseBagInstance(TokenInstance tokenInstance,
ObjectMap vocabulary)
tokenInstance - the instance's category and tokens.vocabulary - the instance's vocabulary.
public SparseBagInstance(int category,
SparseBag bag)
category - the instance's category.bag - the instance's sparse bag.| Method Detail |
public SparseBag bag()
public int numTypes()
Bag
numTypes in interface Bagpublic java.util.Iterator iterator()
Bag
iterator in interface Bagpublic double num(java.lang.Object o)
Bag
num in interface Bago - the object.
public double num()
Bag
num in interface Bag
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||