Java 类org.apache.lucene.analysis.uima.ae.AEProvider 实例源码

项目:search    文件:UIMAUpdateRequestProcessorFactory.java   
@Override
public UpdateRequestProcessor getInstance(SolrQueryRequest req,
    SolrQueryResponse rsp, UpdateRequestProcessor next) {
  SolrUIMAConfiguration configuration = new SolrUIMAConfigurationReader(args)
      .readSolrUIMAConfiguration();
  synchronized (this) {
    if (ae == null && pool == null) {
      AEProvider aeProvider = AEProviderFactory.getInstance().getAEProvider(
          req.getCore().getName(), configuration.getAePath(),
          configuration.getRuntimeParameters());
      try {
        ae = aeProvider.getAE();
        pool = new JCasPool(10, ae);
      } catch (ResourceInitializationException e) {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
      }
    }
  }

  return new UIMAUpdateRequestProcessor(next, req.getCore().getName(),
      configuration, ae, pool);
}
项目:read-open-source-code    文件:UIMAUpdateRequestProcessorFactory.java   
@Override
public UpdateRequestProcessor getInstance(SolrQueryRequest req,
    SolrQueryResponse rsp, UpdateRequestProcessor next) {
  SolrUIMAConfiguration configuration = new SolrUIMAConfigurationReader(args)
      .readSolrUIMAConfiguration();
  synchronized (this) {
    if (ae == null && pool == null) {
      AEProvider aeProvider = AEProviderFactory.getInstance().getAEProvider(
          req.getCore().getName(), configuration.getAePath(),
          configuration.getRuntimeParameters());
      try {
        ae = aeProvider.getAE();
        pool = new JCasPool(10, ae);
      } catch (ResourceInitializationException e) {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
      }
    }
  }

  return new UIMAUpdateRequestProcessor(next, req.getCore().getName(),
      configuration, ae, pool);
}
项目:solrsherlock-maven    文件:CasUpdateRequestProcessor.java   
private void initialize(SolrCore solrCore, SolrUIMAConfiguration config) {
    this.solrCore = solrCore;
    solrUIMAConfiguration = config;
    try {
        desc = SentenceAnnotator.getDescription();
    } catch (ResourceInitializationException e) {
        throw new RuntimeException(e);
    }
    aeProvider = new AEProvider() {

        @Override
        public AnalysisEngine getAE() throws ResourceInitializationException {
            return createPrimitive(desc);
        }

    };
}