Package org.apache.uima

Examples of org.apache.uima.UimaContext


          }
          initializeComponentCasPool(aComponentCasPoolSize, anInitialCasHeapSize);
        }
      }
    } else {
      UimaContext childContext = parentController.getChildUimaContext(endpointName);
      paramsMap.put(Resource.PARAM_UIMA_CONTEXT, childContext);
      initialize(resourceSpecifier, paramsMap);
      initializeComponentCasPool(aComponentCasPoolSize, anInitialCasHeapSize);
      if (parentController instanceof AggregateAnalysisEngineController) {
View Full Code Here


        }
      }
    }
    else
    {
      UimaContext childContext = parentController.getChildUimaContext(endpointName);
      paramsMap.put(Resource.PARAM_UIMA_CONTEXT, childContext);
      initialize(resourceSpecifier, paramsMap);
      initializeComponentCasPool(aComponentCasPoolSize, anInitialCasHeapSize );
      if (aParentController instanceof AggregateAnalysisEngineController )
      {
View Full Code Here

    //TODO: Pei- For unit tests, we should wire up the pipeline programmatically.
    //We can use uimafit instead of xml descriptor files.

    String descriptor = "desc/test/NegationAnnotator.xml";
    AnalysisEngine contextAE = TestUtil.getAE(new File(descriptor));
    UimaContext uimaContext = contextAE.getUimaContext();
    ContextAnnotator negationAnnotator = new ContextAnnotator();
//    negationAnnotator.initialize(uimaContext);
//
//    TestUtil.testConfigParam(uimaContext, descriptor, ContextAnnotator.MAX_LEFT_SCOPE_SIZE_PARAM, new Integer(10));
//    TestUtil.testConfigParam(uimaContext, descriptor, ContextAnnotator.MAX_RIGHT_SCOPE_SIZE_PARAM, new Integer(10));
View Full Code Here

  public void testNegationExamples() throws ResourceInitializationException, AnalysisEngineProcessException {
    //TODO: Pei- For unit tests, we should wire up the pipeline programmatically.
    //We can use uimafit instead of xml descriptor files.
    String descriptor = "desc/test/StatusAnnotator.xml";
    AnalysisEngine contextAE = TestUtil.getAE(new File(descriptor));
    UimaContext uimaContext = contextAE.getUimaContext();
    ContextAnnotator statusAnnotator = new ContextAnnotator();
//    statusAnnotator.initialize(uimaContext);
//
//    TestUtil.testConfigParam(uimaContext, descriptor, ContextAnnotator.MAX_LEFT_SCOPE_SIZE_PARAM, new Integer(7));
//    TestUtil.testConfigParam(uimaContext, descriptor, ContextAnnotator.MAX_RIGHT_SCOPE_SIZE_PARAM, new Integer(7));
View Full Code Here

  @Test
  public void testLeftScopeTokens() throws ResourceInitializationException, AnalysisEngineProcessException {

    String descriptor = "desc/test/TestContextAnnotator.xml";
    AnalysisEngine contextAE = TestUtil.getAE(new File(descriptor));
    UimaContext uimaContext = contextAE.getUimaContext();
    ContextAnnotator contextAnnotator = new ContextAnnotator();
//    contextAnnotator.initialize(uimaContext);
//
//    TestUtil.testConfigParam(uimaContext, descriptor, ContextAnnotator.MAX_LEFT_SCOPE_SIZE_PARAM, new Integer(8));
//    TestUtil.testConfigParam(uimaContext, descriptor, ContextAnnotator.CONTEXT_ANNOTATION_CLASS_PARAM, "org.apache.ctakes.typesystem.type.syntax.BaseToken");
View Full Code Here

  @Test
  public void testRightScopeTokens() throws ResourceInitializationException, AnalysisEngineProcessException {

    String descriptor = "desc/test/TestContextAnnotator.xml";
    AnalysisEngine contextAE = TestUtil.getAE(new File(descriptor));
    UimaContext uimaContext = contextAE.getUimaContext();
    ContextAnnotator contextAnnotator = new ContextAnnotator();
//    contextAnnotator.initialize(uimaContext);
//
//    TestUtil.testConfigParam(uimaContext, descriptor, ContextAnnotator.MAX_RIGHT_SCOPE_SIZE_PARAM, new Integer(4));
//    TestUtil.testConfigParam(uimaContext, descriptor, ContextAnnotator.CONTEXT_ANNOTATION_CLASS_PARAM, "org.apache.ctakes.typesystem.type.syntax.BaseToken");
View Full Code Here

    //TODO: Pei- For unit tests, we should wire up the pipeline programmatically.
    //We can use uimafit instead of xml descriptor files.
   
    String descriptor = "desc/test/TestContextAnnotator.xml";
    AnalysisEngine contextAE = TestUtil.getAE(new File(descriptor));
    UimaContext uimaContext = contextAE.getUimaContext();
    ContextAnnotator contextAnnotator = new ContextAnnotator();
//    contextAnnotator.initialize(uimaContext);
//
//    TestUtil.testConfigParam(uimaContext, descriptor, ContextAnnotator.CONTEXT_ANNOTATION_CLASS_PARAM, "org.apache.ctakes.typesystem.type.syntax.BaseToken");
//
View Full Code Here

      return new MappingFileReader(parser, elementMappers);
  }

  private void getIndexWriterInstance()
      throws ResourceInitializationException {
    UimaContext uimaContext = getContext();
    IndexWriterProvider indexWriterProvider;
    try {
      indexWriterProvider = (IndexWriterProvider) uimaContext
          .getResourceObject(RESOURCE_INDEX_WRITER_PROVIDER);
    } catch (ResourceAccessException e) {
      throw new ResourceInitializationException(e);
    }
    indexWriter = indexWriterProvider.getIndexWriter();
View Full Code Here

          }
          initializeComponentCasPool(aComponentCasPoolSize, anInitialCasHeapSize, disableJCasCache);
        }
      }
    } else {
      UimaContext childContext = parentController.getChildUimaContext(endpointName);
      if ( childContext != null && childContext instanceof UimaContextAdmin ) {
        // check requested Cas logging
        String qualifiedContextName = ((UimaContextAdmin)childContext).getQualifiedContextName();
        if (casLogComponents!= null && (this instanceof AggregateAnalysisEngineController) &&
                casLogComponents.contains(anEndpointName)) {
View Full Code Here

        } else {
          serviceName = "Top Level Aggregate Service";
        }
      } else {
        try {
          UimaContext childContext = parentController.getChildUimaContext(endpointName);
          serviceName = ((UimaContextAdmin)childContext).getQualifiedContextName();
          if ( serviceName != null ) {
            if ( serviceName.startsWith("/")) {
              serviceName = serviceName.substring(1);
              serviceName = serviceName.replaceAll("/", "_"); // normalize
View Full Code Here

TOP

Related Classes of org.apache.uima.UimaContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.