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 intlocalIndex(long globalNumber)Returns the index to which a given term number is mapped by this strategy.longlocalNumber(long globalNumber)Returns the local term number given a global term number.static voidmain(String[] arg)intnumberOfLocalIndices()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:PartitioningStrategyReturns the number of local indices created by this strategy.- Specified by:
numberOfLocalIndicesin interfacePartitioningStrategy- Returns:
- the number of local indices created by this strategy.
-
localIndex
public int localIndex(long globalNumber)
Description copied from interface:LexicalPartitioningStrategyReturns the index to which a given term number is mapped by this strategy.- Specified by:
localIndexin 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:LexicalPartitioningStrategyReturns the local term number given a global term number.- Specified by:
localNumberin 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:PartitioningStrategyReturns an array of properties, one for each local index, that specify additional information about local indices.- Specified by:
propertiesin 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.JSAPExceptionIOExceptionorg.apache.commons.configuration.ConfigurationExceptionSecurityExceptionURISyntaxExceptionClassNotFoundExceptionInstantiationExceptionIllegalAccessExceptionInvocationTargetExceptionNoSuchMethodException
-
-