本文整理汇总了Java中org.galagosearch.core.retrieval.structured.SynonymIterator类的典型用法代码示例。如果您正苦于以下问题:Java SynonymIterator类的具体用法?Java SynonymIterator怎么用?Java SynonymIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SynonymIterator类属于org.galagosearch.core.retrieval.structured包,在下文中一共展示了SynonymIterator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testTwoDocuments
import org.galagosearch.core.retrieval.structured.SynonymIterator; //导入依赖的package包/类
public void testTwoDocuments() throws IOException {
int[][] dataOne = {{1, 3}};
int[][] dataTwo = {{2, 4}};
FakeExtentIterator one = new FakeExtentIterator(dataOne);
FakeExtentIterator two = new FakeExtentIterator(dataTwo);
FakeExtentIterator[] iters = { one, two };
SynonymIterator instance = new SynonymIterator(new Parameters(), iters);
ExtentArray array = instance.extents();
assertFalse(instance.isDone());
assertEquals(1, array.getPosition());
assertEquals(1, array.getBuffer()[0].document);
assertEquals(3, array.getBuffer()[0].begin);
assertEquals(4, array.getBuffer()[0].end);
instance.nextDocument();
assertFalse(instance.isDone());
assertEquals(1, array.getPosition());
assertEquals(2, array.getBuffer()[0].document);
assertEquals(4, array.getBuffer()[0].begin);
assertEquals(5, array.getBuffer()[0].end);
instance.nextDocument();
assertTrue(instance.isDone());
}
示例2: testSameDocument
import org.galagosearch.core.retrieval.structured.SynonymIterator; //导入依赖的package包/类
public void testSameDocument() throws IOException {
int[][] dataOne = {{1, 3}};
int[][] dataTwo = {{1, 4}};
FakeExtentIterator one = new FakeExtentIterator(dataOne);
FakeExtentIterator two = new FakeExtentIterator(dataTwo);
FakeExtentIterator[] iters = { one, two };
SynonymIterator instance = new SynonymIterator(new Parameters(), iters);
ExtentArray array = instance.extents();
assertFalse(instance.isDone());
assertEquals(array.getPosition(), 2);
assertEquals(array.getBuffer()[0].document, 1);
assertEquals(array.getBuffer()[0].begin, 3);
assertEquals(array.getBuffer()[0].end, 4);
assertEquals(array.getBuffer()[1].document, 1);
assertEquals(array.getBuffer()[1].begin, 4);
assertEquals(array.getBuffer()[1].end, 5);
instance.nextDocument();
assertTrue(instance.isDone());
}
示例3: testNoData
import org.galagosearch.core.retrieval.structured.SynonymIterator; //导入依赖的package包/类
public void testNoData() throws IOException {
int[][] dataOne = {};
FakeExtentIterator one = new FakeExtentIterator(dataOne);
FakeExtentIterator[] iters = { one };
SynonymIterator instance = new SynonymIterator(new Parameters(), iters);
assertTrue(instance.isDone());
}
示例4: testGetClassName
import org.galagosearch.core.retrieval.structured.SynonymIterator; //导入依赖的package包/类
/**
* Test of getClassName method, of class FeatureFactory.
*/
public void testGetClassName() throws Exception {
FeatureFactory f = new FeatureFactory(new Parameters());
String actual = f.getClassName(new Node("syn", "fakeargument"));
assertEquals(SynonymIterator.class.getName(), actual);
}