本文整理汇总了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));
}
示例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);
}
示例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());
}
示例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));
}
示例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]);
}
示例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]);
}
示例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());
}
示例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())));
}
示例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);
}
示例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());
}