當前位置: 首頁>>代碼示例>>Java>>正文


Java FeatureFactory類代碼示例

本文整理匯總了Java中org.galagosearch.core.retrieval.structured.FeatureFactory的典型用法代碼示例。如果您正苦於以下問題:Java FeatureFactory類的具體用法?Java FeatureFactory怎麽用?Java FeatureFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FeatureFactory類屬於org.galagosearch.core.retrieval.structured包,在下文中一共展示了FeatureFactory類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testGetTraversalNames

import org.galagosearch.core.retrieval.structured.FeatureFactory; //導入依賴的package包/類
public void testGetTraversalNames() throws Exception {
    String config = "" +
        "<parameters>\n" +
        "    <traversals>\n" +
        "        <traversal>\n" +
        "            <class>b</class>\n" +
        "            <order>after</order>\n" +
        "        </traversal>\n" +
        "        <traversal>\n" +
        "            <class>a</class>\n" +
        "            <order>before</order>\n" +
        "        </traversal>\n" +
        "        <traversal>\n" +
        "            <class>c</class>\n" +
        "            <order>before</order>\n" +
        "        </traversal>\n" +
        "    </traversals>\n" +
        "</parameters>";
    Parameters p = new Parameters(config.getBytes("UTF-8"));
    FeatureFactory f = new FeatureFactory(p);
    List<String> traversalNames = f.getTraversalNames();

    assertEquals("a", traversalNames.get(0));
    assertEquals("c", traversalNames.get(1));
    assertEquals("b", traversalNames.get(traversalNames.size()-1));
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:27,代碼來源:FeatureFactoryTest.java

示例2: testGetFeatureClassName

import org.galagosearch.core.retrieval.structured.FeatureFactory; //導入依賴的package包/類
/**
 * Test of getFeatureClassName method, of class FeatureFactory.
 */
public void testGetFeatureClassName() throws Exception {
    FeatureFactory f = new FeatureFactory(new Parameters());
    Parameters p = new Parameters();
    p.add("default", "dirichlet");
    String actual = f.getFeatureClassName(p);
    assertEquals(DirichletScorer.class.getName(), actual);
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:11,代碼來源:FeatureFactoryTest.java

示例3: testGetNodeType

import org.galagosearch.core.retrieval.structured.FeatureFactory; //導入依賴的package包/類
/**
 * Test of getNodeType method, of class FeatureFactory.
 */
public void testGetNodeType() throws Exception {
    FeatureFactory f = new FeatureFactory(new Parameters());
    NodeType type = f.getNodeType(new Node("combine", ""));
    Class c = type.getIteratorClass();
    assertEquals(UnfilteredCombinationIterator.class.getName(), c.getName());
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:10,代碼來源:FeatureFactoryTest.java

示例4: testIsUsableConstructor

import org.galagosearch.core.retrieval.structured.FeatureFactory; //導入依賴的package包/類
/**
 * Test of isUsableConstructor method, of class FeatureFactory.
 */
public void testIsUsableConstructor() {
    FeatureFactory f = new FeatureFactory(new Parameters());
    Class[] types = new Class[] { Parameters.class };
    ArrayList<StructuredIterator> iterators = new ArrayList();
    assertTrue(f.isUsableConstructor(types, iterators));
    
    types = new Class[] { Parameters.class, ExtentIterator.class };
    iterators.clear();
    iterators.add(new NullExtentIterator());
    assertTrue(f.isUsableConstructor(types, iterators));
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:15,代碼來源:FeatureFactoryTest.java

示例5: testArgsForConstructor

import org.galagosearch.core.retrieval.structured.FeatureFactory; //導入依賴的package包/類
/**
 * Test of argsForConstructor method, of class FeatureFactory.
 */
public void testArgsForConstructor() {
    FeatureFactory f = new FeatureFactory(new Parameters());
    Parameters p = new Parameters();
    Class[] types = new Class[] { Parameters.class };
    Object[] args = f.argsForConstructor(types, p, new ArrayList());
    assertEquals(1, args.length);
    assertEquals(p, args[0]);
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:12,代碼來源:FeatureFactoryTest.java

示例6: testArrayArgsForConstructor

import org.galagosearch.core.retrieval.structured.FeatureFactory; //導入依賴的package包/類
public void testArrayArgsForConstructor() {
    FeatureFactory f = new FeatureFactory(new Parameters());
    ArrayList<StructuredIterator> iterators = new ArrayList();
    iterators.add(new NullExtentIterator());
    ExtentIterator[] fakeArray = new ExtentIterator[1];
    Class[] types = { Parameters.class, fakeArray.getClass() };
    Object[] args = f.argsForConstructor(types, new Parameters(), iterators);
    assertEquals(2, args.length);
    assertEquals(Parameters.class.getName(), args[0].getClass().getName());
    
    ExtentIterator[] array = (ExtentIterator[]) args[1];
    assertEquals(iterators.get(0), array[0]);
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:14,代碼來源:FeatureFactoryTest.java

示例7: testGetIterator

import org.galagosearch.core.retrieval.structured.FeatureFactory; //導入依賴的package包/類
/**
 * Test of getIterator method, of class FeatureFactory.
 */
public void testGetIterator() throws Exception {
    FeatureFactory f = new FeatureFactory(new Parameters());
    ArrayList<StructuredIterator> iterators = new ArrayList();
    iterators.add(new NullExtentIterator());
    StructuredIterator iterator = f.getIterator(new Node("od", "5"), iterators);
    assertEquals(OrderedWindowIterator.class.getName(), iterator.getClass().getName());
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:11,代碼來源:FeatureFactoryTest.java

示例8: testGetClassNameConfig

import org.galagosearch.core.retrieval.structured.FeatureFactory; //導入依賴的package包/類
public void testGetClassNameConfig() throws Exception {
    String config = "" +
        "<parameters>\n" +
        "    <operators>\n" +
        "        <operator>\n" +
        "            <class>b</class>\n" +
        "            <name>a</name>\n" +
        "        </operator>\n" +
        "    </operators>\n" +
        "</parameters>";
    Parameters p = new Parameters(config.getBytes("UTF-8"));
    FeatureFactory f = new FeatureFactory(p);

    assertEquals("b", f.getClassName(new Node("a", new ArrayList())));
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:16,代碼來源:FeatureFactoryTest.java

示例9: testGetClassName

import org.galagosearch.core.retrieval.structured.FeatureFactory; //導入依賴的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

示例10: testGetClass

import org.galagosearch.core.retrieval.structured.FeatureFactory; //導入依賴的package包/類
/**
 * Test of getClass method, of class FeatureFactory.
 */
public void testGetClass() throws Exception {
    FeatureFactory f = new FeatureFactory(new Parameters());
    Class c = f.getClass(new Node("combine", ""));
    assertEquals(UnfilteredCombinationIterator.class.getName(), c.getName());
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:9,代碼來源:FeatureFactoryTest.java


注:本文中的org.galagosearch.core.retrieval.structured.FeatureFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。