当前位置: 首页>>代码示例>>Java>>正文


Java SynonymIterator类代码示例

本文整理汇总了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());
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:27,代码来源:SynonymIteratorTest.java

示例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());
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:24,代码来源:SynonymIteratorTest.java

示例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());
}
 
开发者ID:youngilcho,项目名称:internet-application-2014,代码行数:9,代码来源:SynonymIteratorTest.java

示例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);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:9,代码来源:FeatureFactoryTest.java


注:本文中的org.galagosearch.core.retrieval.structured.SynonymIterator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。