it.unimi.di.mg4j.index.cluster
Class SubsetLexicalStrategy

java.lang.Object
  extended by it.unimi.di.mg4j.index.cluster.SubsetLexicalStrategy
All Implemented Interfaces:
LexicalPartitioningStrategy, PartitioningStrategy, Serializable

public class SubsetLexicalStrategy
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
SubsetLexicalStrategy(IntSet subset)
          Creates a new subset lexical strategy.
 
Method Summary
 int localIndex(int globalNumber)
          Returns the index to which a given term number is mapped by this strategy.
 int localNumber(int 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubsetLexicalStrategy

public SubsetLexicalStrategy(IntSet 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 interface PartitioningStrategy
Returns:
the number of local indices created by this strategy.

localIndex

public int localIndex(int globalNumber)
Description copied from interface: LexicalPartitioningStrategy
Returns the index to which a given term number is mapped by this strategy.

Specified by:
localIndex in interface LexicalPartitioningStrategy
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 int localNumber(int globalNumber)
Description copied from interface: LexicalPartitioningStrategy
Returns the local term number given a global term number.

Specified by:
localNumber in interface LexicalPartitioningStrategy
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 interface PartitioningStrategy
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,
                        ConfigurationException,
                        SecurityException,
                        URISyntaxException,
                        ClassNotFoundException,
                        InstantiationException,
                        IllegalAccessException,
                        InvocationTargetException,
                        NoSuchMethodException
Throws:
com.martiansoftware.jsap.JSAPException
IOException
ConfigurationException
SecurityException
URISyntaxException
ClassNotFoundException
InstantiationException
IllegalAccessException
InvocationTargetException
NoSuchMethodException