⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scantest.java

📁 MG4J (Managing Gigabytes for Java) is a free full-text search engine for large document collections
💻 JAVA
字号:
package test.it.unimi.dsi.mg4j.tool;import it.unimi.dsi.mg4j.index.Index;import it.unimi.dsi.mg4j.index.IndexIterator;import it.unimi.dsi.mg4j.tool.IndexBuilder;import java.io.File;import java.io.IOException;import java.lang.reflect.InvocationTargetException;import java.net.URISyntaxException;import junit.framework.TestCase;import org.apache.commons.configuration.ConfigurationException;import test.it.unimi.dsi.mg4j.document.StringArrayDocumentCollection;public class ScanTest extends TestCase {	public void testEverywhereTerms() throws IOException, ConfigurationException, SecurityException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {				String basename = File.createTempFile( getClass().getSimpleName(), "everywhereTerms" ).getCanonicalPath();		new IndexBuilder( basename, new StringArrayDocumentCollection( "a a" ) ).keepBatches( true ).run();		IndexIterator indexIterator = Index.getInstance( basename + "-text@0" ).documents( 0 );		indexIterator.next();		assertEquals( 2, indexIterator.count() );		int[] position = new int[ 2 ];		indexIterator.positions( position );		assertEquals( 0, position[ 0 ] );		assertEquals( 1, position[ 1 ] );	} }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -