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

test.it.unimi.dsi.big.mg4j.tool.TestDowncaseTermProcessor 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.tool;

import static org.junit.Assert.assertTrue;
import it.unimi.dsi.big.mg4j.index.DowncaseTermProcessor;
import it.unimi.dsi.big.mg4j.index.TermProcessor;
import it.unimi.dsi.fastutil.io.BinIO;
import it.unimi.dsi.fastutil.io.FastByteArrayInputStream;
import it.unimi.dsi.fastutil.io.FastByteArrayOutputStream;

import java.io.IOException;

import org.junit.Test;

public class TestDowncaseTermProcessor {

	@Test
	public void testReadResolve() throws IOException, ClassNotFoundException {
		TermProcessor t = DowncaseTermProcessor.getInstance();
		FastByteArrayOutputStream os = new FastByteArrayOutputStream();
		BinIO.storeObject( t, os );
		assertTrue( t == (TermProcessor)BinIO.loadObject( new FastByteArrayInputStream( os.array ) ) );
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy