![JAR search and dependency download from the Maven repository](/logo.png)
test.it.unimi.dsi.big.mg4j.tool.Modulo3DocumentalClusteringStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mg4j-big Show documentation
Show all versions of mg4j-big Show documentation
MG4J (Managing Gigabytes for Java) is a free full-text search engine for large document collections written in Java. The big version is a fork of the original MG4J that can handle more than 2^31 terms and documents.
The newest version!
package it.unimi.dsi.big.mg4j.tool;
import it.unimi.dsi.big.mg4j.index.cluster.DocumentalClusteringStrategy;
import it.unimi.dsi.big.mg4j.index.cluster.DocumentalPartitioningStrategy;
import it.unimi.dsi.util.Properties;
public final class Modulo3DocumentalClusteringStrategy implements DocumentalClusteringStrategy, DocumentalPartitioningStrategy {
private static final long serialVersionUID = 1L;
final int documents;
public Modulo3DocumentalClusteringStrategy( final int documents ) {
this.documents = documents;
}
public long globalPointer( int localIndex, long localPointer ) { return localPointer; }
public long localPointer( long globalPointer ) { return globalPointer; }
public long numberOfDocuments( int localIndex ) { return documents; }
public int numberOfLocalIndices() { return 3; }
public int localIndex( long globalPointer ) { return (int)( globalPointer % 3 ); }
public Properties[] properties() { return new Properties[ 3 ]; }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy