|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unimi.di.mg4j.index.cluster.ChainedLexicalClusteringStrategy
public class ChainedLexicalClusteringStrategy
A lexical clustering strategy that uses a chain of responsability to choose the local index: term maps out of a given list are inquired until one contains the given term.
If the index cluster has Bloom filters, they will be used to reduce useless accesses to term maps.
The intended usage of this class is memory/disk lexical partitioning. Note that a serialised version of this class is empty. It acts just like a placeholder, so that loaders now that they must generate a new instance depending on the indices contained in the cluster.
Constructor Summary | |
---|---|
ChainedLexicalClusteringStrategy(Index[] index)
Creates a new chained lexical clustering strategy. |
|
ChainedLexicalClusteringStrategy(Index[] index,
BloomFilter[] termFilter)
Creates a new chained lexical clustering strategy using additional Bloom filters. |
Method Summary | |
---|---|
int |
globalNumber(int localIndex,
int localNumber)
Returns the global term number given a local index and a local term number (optional operation). |
int |
localIndex(CharSequence term)
Returns the index to which a given term is be mapped by this strategy. |
int |
numberOfLocalIndices()
Returns the number of local indices handled by this strategy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChainedLexicalClusteringStrategy(Index[] index, BloomFilter[] termFilter)
Note that the static type of the parameter index
is
an array of Index
, but the elements of the array must be
disk-based indices, or an exception will be thrown.
index
- an array of disk-based indices, from which term maps will be extracted.termFilter
- an array, parallel to index
, of Bloom filter representing the terms contained in each local index.public ChainedLexicalClusteringStrategy(Index[] index)
Note that the static type of the parameter index
is
an array of Index
, but the elements of the array must be
disk-based indices, or an exception will be thrown.
index
- an array of disk-based indices, from which term maps will be extracted.Method Detail |
---|
public int numberOfLocalIndices()
ClusteringStrategy
numberOfLocalIndices
in interface ClusteringStrategy
public int localIndex(CharSequence term)
LexicalClusteringStrategy
localIndex
in interface LexicalClusteringStrategy
term
- a term.
public int globalNumber(int localIndex, int localNumber)
LexicalClusteringStrategy
This operation is not, in general, necessary for a LexicalCluster
to work, as no action on a local index returns local numbers. It is defined here
mainly for completeness and for debugging purposes (in case it is implemented).
globalNumber
in interface LexicalClusteringStrategy
localIndex
- the local index.localNumber
- the local term number.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |