本文整理汇总了Java中org.cleartk.ml.CleartkSequenceAnnotator.initialize方法的典型用法代码示例。如果您正苦于以下问题:Java CleartkSequenceAnnotator.initialize方法的具体用法?Java CleartkSequenceAnnotator.initialize怎么用?Java CleartkSequenceAnnotator.initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cleartk.ml.CleartkSequenceAnnotator
的用法示例。
在下文中一共展示了CleartkSequenceAnnotator.initialize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBadFileName
import org.cleartk.ml.CleartkSequenceAnnotator; //导入方法依赖的package包/类
@Test
public void testBadFileName() throws Throwable {
try {
CleartkSequenceAnnotator<String> classifierAnnotator = new StringTestAnnotator();
classifierAnnotator.initialize(UimaContextFactory.createUimaContext(
GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
new File(outputDirectoryName, "asdf.jar").getPath()));
classifierAnnotator.classify(Collections.singletonList(InstanceFactory.createInstance(
"hello",
1,
1)));
fail("expected exception for invalid classifier name");
} catch (ResourceInitializationException e) {
}
}
示例2: testStringClassifierStringAnnotator
import org.cleartk.ml.CleartkSequenceAnnotator; //导入方法依赖的package包/类
@Test
public void testStringClassifierStringAnnotator() throws Exception {
CleartkSequenceAnnotator<String> classifierAnnotator = new StringTestAnnotator();
classifierAnnotator.initialize(UimaContextFactory.createUimaContext(
CleartkSequenceAnnotator.PARAM_CLASSIFIER_FACTORY_CLASS_NAME,
StringTestClassifierFactory.class.getName()));
classifierAnnotator.classify(Collections.singletonList(InstanceFactory.createInstance(
"hello",
1,
1)));
}
示例3: testChildClassifierParentAnnotator
import org.cleartk.ml.CleartkSequenceAnnotator; //导入方法依赖的package包/类
@Test
public void testChildClassifierParentAnnotator() throws Exception {
CleartkSequenceAnnotator<Parent> classifierAnnotator = new ParentTestAnnotator();
classifierAnnotator.initialize(UimaContextFactory.createUimaContext(
CleartkSequenceAnnotator.PARAM_CLASSIFIER_FACTORY_CLASS_NAME,
ChildTestClassifierFactory.class.getName()));
}
示例4: testGenericClassifierGenericAnnotator
import org.cleartk.ml.CleartkSequenceAnnotator; //导入方法依赖的package包/类
@Test
public void testGenericClassifierGenericAnnotator() throws Exception {
CleartkSequenceAnnotator<Object> classifierAnnotator = new TestAnnotator<Object>();
classifierAnnotator.initialize(UimaContextFactory.createUimaContext(
CleartkSequenceAnnotator.PARAM_CLASSIFIER_FACTORY_CLASS_NAME,
TestClassifierFactory.class.getName()));
}