All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.it.unimi.dsi.big.mg4j.index.cluster.LexicalPartitioningStrategy Maven / Gradle / Ivy

Go to download

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.index.cluster;

/*		 
 * MG4J: Managing Gigabytes for Java (big)
 *
 * Copyright (C) 2006-2011 Sebastiano Vigna 
 *
 *  This library is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU Lesser General Public License as published by the Free
 *  Software Foundation; either version 3 of the License, or (at your option)
 *  any later version.
 *
 *  This library is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 *  for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this program; if not, see .
 *
 */

/** A way to associate a term number with a local index out of a given set and a local term number in the local index.
 * 
 * 

When partitioning lexically an index (i.e., termwise), we need a way to associate * to each term {@linkplain #localIndex(long) a local index} (the index * that will contain the postings of that term) and {@linkplain #localNumber(long) a local * term number} (the number of the term in the local index). * *

Usually, a lexical partitioning strategy has a matching * {@link it.unimi.dsi.big.mg4j.index.cluster.LexicalClusteringStrategy} whose methods * satisfy the following equations: *

 * globalNumber(localIndex(t), localNumber(t)) = t
 * <localIndex(globalNumber(i, l)), localNumber(globalNumber(i, l))> = <i, l>
 * 
* * @author Alessandro Arrabito * @author Sebastiano Vigna */ public interface LexicalPartitioningStrategy extends PartitioningStrategy { /** Returns the index to which a given term number is mapped by this strategy. * * @param globalNumber the term global number. * @return the corresponding local index, or -1 if the term should be removed from the partitioned index. */ int localIndex( long globalNumber ); /** Returns the local term number given a global term number. * @param globalNumber a global term number. * @return the corresponding local term number, or -1 if the term should be removed from the partitioned index. */ long localNumber( final long globalNumber ); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy