|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.context.PriorRecognitions
public class PriorRecognitions
A buffer of prior Recognition
s that should
be considered in the context representation. The buffer adjusts its size
automatically, discarding the least recently added recognitions when enough
recognitions are stored.
Allows to cache feature vectors representing recognitions (caching should only be used for sealed recognitions because otherwise the cached features might get out-of-date).
Instances of this class and the nested class
PriorRecognitions.Pair
are not thread-safe.
Nested Class Summary | |
---|---|
static class |
PriorRecognitions.Pair
An inner class wrapping a recognition and optionally a feature vector representing the recognition. |
Constructor Summary | |
---|---|
PriorRecognitions(int size)
Creates a new instance. |
Method Summary | |
---|---|
void |
add(Recognition recognition)
Adds the given recognition to this buffer, discarding the least recently added recognition if appropriate. |
Iterator |
iterator()
Returns an iterator over the elements stored in this instance. |
Recognition |
removeLast()
Removes the most recently inserted recognition from this buffer. |
int |
size()
Returns the number of recognitions stored in the buffer. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PriorRecognitions(int size)
size
- the number of prior recognitions to store; if 0 this is
just a dummy instance that throws away any recognitions that are
addedMethod Detail |
---|
public void add(Recognition recognition)
recognition
- the recognition to addpublic Iterator iterator()
PriorRecognitions.Pair
s (not
Recognition
s). These pairs can be used to access the recognition
and to retrieve and store feature vectors representing the recognition.
Feature vectors should be cached only for
sealed recognitions because otherwise
the cached features might get out-of-date.
PriorRecognitions.Pair
spublic Recognition removeLast()
null
if this container
is emptypublic int size()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |