Class FrequencyLexicalStrategy
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.cluster.FrequencyLexicalStrategy
-
- All Implemented Interfaces:
LexicalPartitioningStrategy
,PartitioningStrategy
,Serializable
public class FrequencyLexicalStrategy extends Object implements LexicalPartitioningStrategy
A lexical strategy that creates an index containing a subset of the terms.- Author:
- Sebastiano Vigna
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FrequencyLexicalStrategy(LongSet subset)
Creates a new subset lexical strategy.
-
Method Summary
Modifier and Type Method Description int
localIndex(long globalNumber)
Returns the index to which a given term number is mapped by this strategy.long
localNumber(long globalNumber)
Returns the local term number given a global term number.static void
main(String[] arg)
int
numberOfLocalIndices()
Returns the number of local indices created by this strategy.Properties[]
properties()
Returns an array of properties, one for each local index, that specify additional information about local indices.
-
-
-
Constructor Detail
-
FrequencyLexicalStrategy
public FrequencyLexicalStrategy(LongSet subset)
Creates a new subset lexical strategy.- Parameters:
subset
- the subset of terms.
-
-
Method Detail
-
numberOfLocalIndices
public int numberOfLocalIndices()
Description copied from interface:PartitioningStrategy
Returns the number of local indices created by this strategy.- Specified by:
numberOfLocalIndices
in interfacePartitioningStrategy
- Returns:
- the number of local indices created by this strategy.
-
localIndex
public int localIndex(long globalNumber)
Description copied from interface:LexicalPartitioningStrategy
Returns the index to which a given term number is mapped by this strategy.- Specified by:
localIndex
in interfaceLexicalPartitioningStrategy
- Parameters:
globalNumber
- the term global number.- Returns:
- the corresponding local index, or -1 if the term should be removed from the partitioned index.
-
localNumber
public long localNumber(long globalNumber)
Description copied from interface:LexicalPartitioningStrategy
Returns the local term number given a global term number.- Specified by:
localNumber
in interfaceLexicalPartitioningStrategy
- Parameters:
globalNumber
- a global term number.- Returns:
- the corresponding local term number, or -1 if the term should be removed from the partitioned index.
-
properties
public Properties[] properties()
Description copied from interface:PartitioningStrategy
Returns an array of properties, one for each local index, that specify additional information about local indices.- Specified by:
properties
in interfacePartitioningStrategy
- Returns:
- an array of properties, one for each local index; any element
can be
null
(in that case, the set of properties is assumed to be empty).
-
main
public static void main(String[] arg) throws com.martiansoftware.jsap.JSAPException, IOException, org.apache.commons.configuration.ConfigurationException, SecurityException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
- Throws:
com.martiansoftware.jsap.JSAPException
IOException
org.apache.commons.configuration.ConfigurationException
SecurityException
URISyntaxException
ClassNotFoundException
InstantiationException
IllegalAccessException
InvocationTargetException
NoSuchMethodException
-
-