本文整理汇总了Java中org.apache.uima.resource.ResourceAccessException类的典型用法代码示例。如果您正苦于以下问题:Java ResourceAccessException类的具体用法?Java ResourceAccessException怎么用?Java ResourceAccessException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceAccessException类属于org.apache.uima.resource包,在下文中一共展示了ResourceAccessException类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setUp
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
@Before
public void setUp() throws ResourceInitializationException, ResourceAccessException {
// Create a description of an external resource - a fongo instance, in the same way we would
// have created a shared mongo resource
final ExternalResourceDescription erd = ExternalResourceFactory.createExternalResourceDescription(
SharedFongoResource.class, "fongo.collection", "test", "fongo.data", "[]");
// Create the analysis engine
final AnalysisEngineDescription aed = AnalysisEngineFactory.createEngineDescription(MongoPatternSaver.class,
MongoPatternSaver.KEY_MONGO, erd,
"collection", "test");
ae = AnalysisEngineFactory.createEngine(aed);
ae.initialize(new CustomResourceSpecifier_impl(), Collections.emptyMap());
sfr = (SharedFongoResource) ae.getUimaContext()
.getResourceObject(MongoPatternSaver.KEY_MONGO);
}
开发者ID:tenode,项目名称:baleen-extras,代码行数:19,代码来源:MongoPatternSaverTest.java
示例2: initialize
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
/**
* Initializes the current instance with the given context.
*
* Note: Do all initialization in this method, do not use the constructor.
*/
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
TokenizerModel model;
try {
TokenizerModelResource modelResource =
(TokenizerModelResource) context.getResourceObject(UimaUtil.MODEL_PARAMETER);
model = modelResource.getModel();
} catch (ResourceAccessException e) {
throw new ResourceInitializationException(e);
}
tokenizer = new TokenizerME(model);
}
开发者ID:deeplearning4j,项目名称:DataVec,代码行数:23,代码来源:ConcurrentTokenizer.java
示例3: setUp
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
@Before
public void setUp() throws ResourceInitializationException, ResourceAccessException {
// Create a description of an external resource - a fongo instance, in the same way we would have created a shared mongo resource
ExternalResourceDescription erd = ExternalResourceFactory.createExternalResourceDescription(MONGO, SharedFongoResource.class, "fongo.collection", "test", "fongo.data", "[]");
ExternalResourceDescription historyErd = ExternalResourceFactory.createExternalResourceDescription(PipelineBuilder.BALEEN_HISTORY, InMemoryBaleenHistory.class);
history = Mockito.mock(BaleenHistory.class);
// Create the analysis engine
AnalysisEngineDescription aed = AnalysisEngineFactory.createEngineDescription(Mongo.class, MONGO, erd, "collection", "test", PipelineBuilder.BALEEN_HISTORY, historyErd, "outputHistory", Boolean.TRUE);
ae = AnalysisEngineFactory.createEngine(aed);
ae.initialize(new CustomResourceSpecifier_impl(), Collections.emptyMap());
SharedFongoResource sfr = (SharedFongoResource) ae.getUimaContext().getResourceObject(MONGO);
history = (BaleenHistory) ae.getUimaContext().getResourceObject(PipelineBuilder.BALEEN_HISTORY);
entities = sfr.getDB().getCollection("entities");
documents = sfr.getDB().getCollection("documents");
relations = sfr.getDB().getCollection("relations");
// Ensure we start with no data!
assertEquals(0L, documents.count());
assertEquals(0L, entities.count());
assertEquals(0L, relations.count());
}
开发者ID:dstl,项目名称:baleen,代码行数:25,代码来源:MongoTest.java
示例4: test
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
@Test
public void test() throws ResourceInitializationException, AnalysisEngineProcessException, IOException,
ResourceAccessException {
final File file = File.createTempFile("test", "uimt");
Files.write("Type,SubType\nMOVEMENT,went,source,target,went,VERB,gone", file, StandardCharsets.UTF_8);
final AnalysisEngine ae = create(UploadInteractionsToMongo.class, "mongo", fongoErd, "input", file);
execute(ae);
final SharedFongoResource sfr = (SharedFongoResource) ae.getUimaContext().getResourceObject("mongo");
final MongoCollection<Document> relationTypes = sfr.getDB().getCollection("relationTypes");
assertTrue(relationTypes.count() > 0);
final MongoCollection<Document> interactions = sfr.getDB().getCollection("interactions");
assertTrue(interactions.count() > 0);
}
开发者ID:dstl,项目名称:baleen,代码行数:17,代码来源:UploadInteractionsToMongoTest.java
示例5: initialize
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
/**
* Initializes the current instance with the given context.
*
* Note: Do all initialization in this method, do not use the constructor.
*/
public void initialize(UimaContext context)
throws ResourceInitializationException {
super.initialize(context);
TokenizerModel model;
try {
TokenizerModelResource modelResource = (TokenizerModelResource) context
.getResourceObject(UimaUtil.MODEL_PARAMETER);
model = modelResource.getModel();
} catch (ResourceAccessException e) {
throw new ResourceInitializationException(e);
}
tokenizer = new TokenizerME(model);
}
开发者ID:jpatanooga,项目名称:Canova,代码行数:24,代码来源:ConcurrentTokenizer.java
示例6: initialize
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
/**
* Initializes the current instance with the given context.
*
* Note: Do all initialization in this method, do not use the constructor.
*/
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
TokenizerModel model;
try {
TokenizerModelResource modelResource =
(TokenizerModelResource) context.getResourceObject(UimaUtil.MODEL_PARAMETER);
model = modelResource.getModel();
} catch (ResourceAccessException e) {
throw new ResourceInitializationException(e);
}
tokenizer = new TokenizerME(model);
}
开发者ID:deeplearning4j,项目名称:deeplearning4j,代码行数:23,代码来源:ConcurrentTokenizer.java
示例7: initialize
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
@Override
public void initialize(
UimaContext uimaContext,
ProcessingResourceMetaData processingResourceMetaData
) {
LOGGER.info("Initializing xml validating file adapter.");
try {
GuiceInjector guiceInjector = (GuiceInjector) uimaContext.getResourceObject("guiceInjector");
labelAdapters = guiceInjector.attach().getInstance(LabelAdapters.class);
guiceInjector.detach();
} catch (ResourceAccessException | BiomedicusException e) {
throw new IllegalStateException("");
}
}
开发者ID:nlpie,项目名称:biomedicus,代码行数:15,代码来源:RtfTextFileAdapter.java
示例8: beforeMongoRecordConsumerTest
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
@Before
public void beforeMongoRecordConsumerTest() throws ResourceInitializationException, ResourceAccessException {
mongoExternalResourceDescription = ExternalResourceFactory.createExternalResourceDescription(MONGO,
SharedFongoResource.class, "fongo.collection", "test", "fongo.data", "[]");
analysisEngine = getAnalysisEngine("mongo", mongoExternalResourceDescription, "collection", "test");
SharedFongoResource sfr = (SharedFongoResource) analysisEngine.getUimaContext().getResourceObject(MONGO);
recordsCollection = sfr.getDB().getCollection("records");
}
开发者ID:dstl,项目名称:baleen,代码行数:9,代码来源:MongoTemplateRecordConsumerTest.java
示例9: initialize
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
try {
this.chineseWordSegments = (ChineseSegment) context.getResourceObject(CHINESE_WORD_SEGMENTS);
this.chineseForeignNameSegments = (ChineseSegment) context.getResourceObject(CHINESE_FOREIGN_NAME_SEGMENTS);
this.chineseNumberSegments = (ChineseSegment) context.getResourceObject(CHINESE_NUMBER_SEGMENTS);
this.annotationType = (String) context.getConfigParameterValue(ANNOTATION_TYPE);
} catch (ResourceAccessException e) {
throw new ResourceInitializationException(e);
}
}
开发者ID:nantesnlp,项目名称:uima-chinese-segmenter,代码行数:12,代码来源:ChineseSegmenter.java
示例10: initialize
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
/**
* Initializes the current instance with the given context.
*
* Note: Do all initialization in this method, do not use the constructor.
*/
@Override
public void initialize(UimaContext context)
throws ResourceInitializationException {
super.initialize(context);
this.context = context;
this.logger = context.getLogger();
if (this.logger.isLoggable(Level.INFO)) {
this.logger.log(Level.INFO, "Initializing the OpenNLP "
+ "Part of Speech annotator.");
}
POSModel model;
try {
POSModelResource modelResource = (POSModelResource) context
.getResourceObject(UimaUtil.MODEL_PARAMETER);
model = modelResource.getModel();
} catch (ResourceAccessException e) {
throw new ResourceInitializationException(e);
}
Integer beamSize = AnnotatorUtil.getOptionalIntegerParameter(context,
UimaUtil.BEAM_SIZE_PARAMETER);
if (beamSize == null)
beamSize = POSTaggerME.DEFAULT_BEAM_SIZE;
this.posTagger = new POSTaggerME(model, beamSize, 0);
}
开发者ID:jpatanooga,项目名称:Canova,代码行数:40,代码来源:PoStagger.java
示例11: loadAResource
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
public static void loadAResource(CSVDictionaryResource aResource, UimaContext aContext, String aDictionaryResource, String aDictionaryResourceFile)
throws ResourceInitializationException
{
try
{
/* 63 */ loadAResourceObject(aResource, (CSVDictionaryResource)aContext.getResourceObject(aDictionaryResource));
/* 66 */ loadAResourceFromFilePath(aResource, (String)aContext.getConfigParameterValue(aDictionaryResourceFile));
}
catch (ResourceAccessException e) {
/* 69 */ throw new ResourceInitializationException(e);
}
}
开发者ID:nicolashernandez,项目名称:dev-star,代码行数:15,代码来源:ResourceUtils.java
示例12: getResourceURL
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
@Override
public URL getResourceURL(String aKey) throws ResourceAccessException {
// TODO Auto-generated method stub
return null;
}
开发者ID:HeidelTime,项目名称:heideltime,代码行数:6,代码来源:StandaloneConfigContext.java
示例13: getResourceURI
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
@Override
public URI getResourceURI(String aKey) throws ResourceAccessException {
// TODO Auto-generated method stub
return null;
}
开发者ID:HeidelTime,项目名称:heideltime,代码行数:6,代码来源:StandaloneConfigContext.java
示例14: getResourceFilePath
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
@Override
public String getResourceFilePath(String aKey)
throws ResourceAccessException {
// TODO Auto-generated method stub
return null;
}
开发者ID:HeidelTime,项目名称:heideltime,代码行数:7,代码来源:StandaloneConfigContext.java
示例15: getResourceAsStream
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
@Override
public InputStream getResourceAsStream(String aKey)
throws ResourceAccessException {
// TODO Auto-generated method stub
return null;
}
开发者ID:HeidelTime,项目名称:heideltime,代码行数:7,代码来源:StandaloneConfigContext.java
示例16: getResourceObject
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
@Override
public Object getResourceObject(String aKey) throws ResourceAccessException {
// TODO Auto-generated method stub
return null;
}
开发者ID:HeidelTime,项目名称:heideltime,代码行数:6,代码来源:StandaloneConfigContext.java
示例17: loadAResource
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
/**
* Automatic loading, parsing, and building a node
* general Method
* @param aResource this.resource = new CSVDictionaryResource();
* @param aContext
* @param aDictionaryResource
* @param aDictionaryResourceFile
* @throws ResourceInitializationException
*/
public static void loadAResource(CSVDictionaryResource aResource, UimaContext aContext, String aDictionaryResource, String aDictionaryResourceFile) throws ResourceInitializationException {
try {
// Load, parse, and build an index automatically from a conventional declaration of a resource
ResourceUtils.loadAResourceObject(aResource,(CSVDictionaryResource) aContext.getResourceObject(aDictionaryResource));
// Load, parse, and build an index from a declaration of a resource by a file parameter (crush the previous declaration)
ResourceUtils.loadAResourceFromFilePath(aResource, (String) aContext.getConfigParameterValue(aDictionaryResourceFile));
} catch (ResourceAccessException e) {
throw new ResourceInitializationException(e);
}
}
开发者ID:EUMSSI,项目名称:EUMSSI-tools,代码行数:25,代码来源:ResourceUtils.java
示例18: initialize
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
/**
* Initializes the current instance with the given context.
*
* Note: Do all initialization in this method, do not use the constructor.
*/
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
this.context = context;
this.logger = context.getLogger();
if (this.logger.isLoggable(Level.INFO)) {
this.logger.log(Level.INFO, "Initializing the OpenNLP " + "Part of Speech annotator.");
}
POSModel model;
try {
POSModelResource modelResource = (POSModelResource) context.getResourceObject(UimaUtil.MODEL_PARAMETER);
model = modelResource.getModel();
} catch (ResourceAccessException e) {
throw new ResourceInitializationException(e);
}
Integer beamSize = AnnotatorUtil.getOptionalIntegerParameter(context, UimaUtil.BEAM_SIZE_PARAMETER);
if (beamSize == null)
beamSize = POSTaggerME.DEFAULT_BEAM_SIZE;
this.posTagger = new POSTaggerME(model, beamSize, 0);
}
开发者ID:deeplearning4j,项目名称:DataVec,代码行数:36,代码来源:PoStagger.java
示例19: initialize
import org.apache.uima.resource.ResourceAccessException; //导入依赖的package包/类
/**
* Initializes the current instance with the given context.
*
* Note: Do all initialization in this method, do not use the constructor.
*/
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
this.context = context;
this.logger = context.getLogger();
if (this.logger.isLoggable(Level.INFO)) {
this.logger.log(Level.INFO, "Initializing the OpenNLP " + "Part of Speech annotator.");
}
POSModel model;
try {
POSModelResource modelResource = (POSModelResource) context.getResourceObject(UimaUtil.MODEL_PARAMETER);
model = modelResource.getModel();
} catch (ResourceAccessException e) {
throw new ResourceInitializationException(e);
}
Integer beamSize = AnnotatorUtil.getOptionalIntegerParameter(context, UimaUtil.BEAM_SIZE_PARAMETER);
if (beamSize == null)
beamSize = POSTaggerME.DEFAULT_BEAM_SIZE;
this.posTagger = new POSTaggerME(model, beamSize, 0);
}
开发者ID:deeplearning4j,项目名称:deeplearning4j,代码行数:36,代码来源:PoStagger.java
注:本文中的org.apache.uima.resource.ResourceAccessException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论