本文整理汇总了Java中it.uniroma2.sag.kelp.data.example.ExampleFactory类的典型用法代码示例。如果您正苦于以下问题:Java ExampleFactory类的具体用法?Java ExampleFactory怎么用?Java ExampleFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExampleFactory类属于it.uniroma2.sag.kelp.data.example包,在下文中一共展示了ExampleFactory类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDatasetFromString
import it.uniroma2.sag.kelp.data.example.ExampleFactory; //导入依赖的package包/类
public static SimpleDataset getDatasetFromString(String exampleString) {
SimpleDataset dataset = new SimpleDataset();
Example ex = new SimpleExample();
try {
ex = ExampleFactory.parseExample(exampleString);
} catch (Exception e) {
try {
throw new ParsingExampleException(e, exampleString);
} catch (ParsingExampleException e1) {
System.out.println("ERROR");
e1.printStackTrace();
}
}
dataset.addExample(ex);
return dataset;
}
示例2: initializeExamples
import it.uniroma2.sag.kelp.data.example.ExampleFactory; //导入依赖的package包/类
@Before
/**
* This method will be executed before each test method.
*/
public void initializeExamples() {
String reprA = "fakeclass |BDV:"+denseName+"| 1.0,0.0,1.0 |EV| |BV:"+sparseName+"| one:1.0 three:1.0 |EV|";
String reprB = "fakeclass |BDV:"+denseName+"| 0.0,1.0,1.0 |EV| |BV:"+sparseName+"| two:1.0 three:1.0 |EV|";
String reprC = "fakeclass |BDV:"+denseName+"| 0.5,1.0,1.0 |EV| |BV:"+sparseName+"| one:1.0 three:1.0 ten:1.0 |EV|";
try {
Example a = ExampleFactory.parseExample(reprA);
Example b = ExampleFactory.parseExample(reprB);
Example c = ExampleFactory.parseExample(reprC);
dataset = new SimpleDataset();
dataset.addExample(a);
dataset.addExample(b);
dataset.addExample(c);
} catch (InstantiationException e) {
e.printStackTrace();
Assert.fail();
}
}