本文整理汇总了Java中org.galagosearch.core.retrieval.structured.SynonymIterator.nextDocument方法的典型用法代码示例。如果您正苦于以下问题:Java SynonymIterator.nextDocument方法的具体用法?Java SynonymIterator.nextDocument怎么用?Java SynonymIterator.nextDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.galagosearch.core.retrieval.structured.SynonymIterator
的用法示例。
在下文中一共展示了SynonymIterator.nextDocument方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}