public class AbstractCoOccurrences<T extends SequenceElement>
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
AbstractCoOccurrences.Builder<T extends SequenceElement> |
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.locks.ReentrantReadWriteLock |
lock |
protected static org.slf4j.Logger |
logger |
protected long |
memory_threshold |
protected SequenceIterator<T> |
sequenceIterator |
protected boolean |
symmetric |
protected java.io.File |
targetFile |
protected VocabCache<T> |
vocabCache |
protected int |
windowSize |
protected int |
workers |
Modifier and Type | Method and Description |
---|---|
void |
fit() |
double |
getCoOccurrenceCount(T element1,
T element2)
This method returns cooccurrence distance weights for two SequenceElements
|
protected long |
getMemoryFootprint()
This method returns estimated memory footrpint, based on current CountMap content
|
protected long |
getMemoryThreshold()
This memory returns memory threshold, defined as 1/2 of memory allowed for allocation
|
java.util.Iterator<Pair<Pair<T,T>,java.lang.Double>> |
iterator()
This method returns iterator with elements pairs and their weights.
|
protected boolean symmetric
protected int windowSize
protected VocabCache<T extends SequenceElement> vocabCache
protected SequenceIterator<T extends SequenceElement> sequenceIterator
protected int workers
protected java.io.File targetFile
protected java.util.concurrent.locks.ReentrantReadWriteLock lock
protected long memory_threshold
protected static final org.slf4j.Logger logger
public double getCoOccurrenceCount(@NonNull T element1, @NonNull T element2)
element1
- element2
- protected long getMemoryFootprint()
protected long getMemoryThreshold()
public void fit()
public java.util.Iterator<Pair<Pair<T,T>,java.lang.Double>> iterator()