当前位置: 首页>>代码示例>>Java>>正文


Java ExternalResourceFactory.createDependencyAndBind方法代码示例

本文整理汇总了Java中org.apache.uima.fit.factory.ExternalResourceFactory.createDependencyAndBind方法的典型用法代码示例。如果您正苦于以下问题:Java ExternalResourceFactory.createDependencyAndBind方法的具体用法?Java ExternalResourceFactory.createDependencyAndBind怎么用?Java ExternalResourceFactory.createDependencyAndBind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.uima.fit.factory.ExternalResourceFactory的用法示例。


在下文中一共展示了ExternalResourceFactory.createDependencyAndBind方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createChineseSegmenterAE

import org.apache.uima.fit.factory.ExternalResourceFactory; //导入方法依赖的package包/类
public static AnalysisEngineDescription createChineseSegmenterAE(String annotationType) {
	try {
		AnalysisEngineDescription ae = AnalysisEngineFactory.createEngineDescription(
				ChineseSegmenter.class,
				ChineseSegmenter.ANNOTATION_TYPE, annotationType
			);
		ExternalResourceFactory.createDependencyAndBind(
				ae,
				ChineseSegmenter.CHINESE_WORD_SEGMENTS, 
				ChineseSegmentResource.class, 
				ChineseSegmenterResourceHelper.getChineseWordSegments());
		ExternalResourceFactory.createDependencyAndBind(
				ae,
				ChineseSegmenter.CHINESE_FOREIGN_NAME_SEGMENTS, 
				ChineseSegmentResource.class, 
				ChineseSegmenterResourceHelper.getForeignNameSegments());
		ExternalResourceFactory.createDependencyAndBind(
				ae,
				ChineseSegmenter.CHINESE_NUMBER_SEGMENTS, 
				ChineseSegmentResource.class, 
				ChineseSegmenterResourceHelper.getNumberSegments());
		return ae;
	} catch(Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:nantesnlp,项目名称:uima-chinese-segmenter,代码行数:27,代码来源:ChineseSegmenterFactory.java

示例2: getConceptMapper

import org.apache.uima.fit.factory.ExternalResourceFactory; //导入方法依赖的package包/类
public static AnalysisEngineDescription getConceptMapper(String path,
        AnalysisEngineDescription tokenDesc) throws UIMAException,
        IOException, SAXException {

    String conceptMapper = LEXICA_ROOT + "desc/" + path
            + "ConceptMapper.xml";
    checkArgument(new File(conceptMapper).exists(),
            "no ConceptMapper file at " + conceptMapper);

    String lexicon = LEXICA_ROOT + "resources/" + path + ".xml";
    checkArgument(new File(lexicon).exists(), "no lexicon file at "
            + lexicon);

    AnalysisEngineDescription aed = (AnalysisEngineDescription) createResourceCreationSpecifier(
            conceptMapper, new Object[] { "TokenizerDescriptorPath",
                    getTokenDescPath(tokenDesc), "Stemmer",
                    SCharsStemmer.class.getName() });

    // Create the external resource dependency for the model and bind it
    ExternalResourceFactory.createDependencyAndBind(aed, "DictionaryFile",
            DictionaryResource_impl.class, "file:" + lexicon);
    return aed;
}
 
开发者ID:BlueBrain,项目名称:bluima,代码行数:24,代码来源:LexicaHelper.java

示例3: createMateAEDesc

import org.apache.uima.fit.factory.ExternalResourceFactory; //导入方法依赖的package包/类
public static AnalysisEngineDescription createMateAEDesc(ResourceConfig resourceConfig, Lang lang, Path mateModelPath) {
	try {
		AnalysisEngineDescription mateTaggerAE = AnalysisEngineFactory.createEngineDescription(
			MateLemmatizerTagger.class
		);
		
		String lemmatizerModel = mateModelPath.resolve("mate-lemma-"+lang.getCode()+".model").toString();
		String taggerModel = mateModelPath.resolve("mate-pos-"+lang.getCode()+".model").toString();
		Preconditions.checkArgument(Files.exists(Paths.get(lemmatizerModel)), "Lemmatizer model does not exist: %s", lemmatizerModel);
		Preconditions.checkArgument(Files.exists(Paths.get(taggerModel)), "Tagger model does not exist: %s", taggerModel);

		ExternalResourceFactory.createDependencyAndBind(
				mateTaggerAE,
				MateLemmatizerTagger.LEMMATIZER, 
				MateLemmatizerModel.class, 
				lemmatizerModel);
		ExternalResourceFactory.createDependencyAndBind(
				mateTaggerAE,
				MateLemmatizerTagger.TAGGER, 
				MateTaggerModel.class, 
				taggerModel);
		
		AnalysisEngineDescription lemmaFixerAE = AnalysisEngineFactory.createEngineDescription(
				MateLemmaFixer.class,
				MateLemmaFixer.LANGUAGE, lang.getCode()
			);

		AnalysisEngineDescription normalizerAE = createNormalizerAE(resourceConfig, lang, Tagger.MATE);

		return AnalysisEngineFactory.createEngineDescription(
				mateTaggerAE,
				lemmaFixerAE, 
				normalizerAE);

	} catch (Exception e) {
		throw new TermSuiteException(e);
	}
}
 
开发者ID:termsuite,项目名称:termsuite-core,代码行数:39,代码来源:CustomResourceTermSuiteAEFactory.java


注:本文中的org.apache.uima.fit.factory.ExternalResourceFactory.createDependencyAndBind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。