Package org.apache.uima.resource

Examples of org.apache.uima.resource.ResourceInitializationException


   
    if (featureGeneratorDefinitionFile != null) {
      try {
        featureGeneratorDefinition = OpennlpUtil.loadBytes(new File(featureGeneratorDefinitionFile));
      } catch (IOException e) {
        throw new ResourceInitializationException(e);
      }
     
      String featureGeneratorResourcesDirName = CasConsumerUtil.getOptionalStringParameter(
          getUimaContext(), FEATURE_GENERATOR_RESOURCES_PARAMETER);
     
View Full Code Here


      DoccatModelResource modelResource = (DoccatModelResource) context
          .getResourceObject(UimaUtil.MODEL_PARAMETER);

      model = modelResource.getModel();
    } catch (ResourceAccessException e) {
      throw new ResourceInitializationException(e);
    }

    mCategorizer = new DocumentCategorizerME(model);
  }
View Full Code Here

            (TokenNameFinderModelResource) context.getResourceObject(UimaUtil.MODEL_PARAMETER);
       
        model = modelResource.getModel();
    }
    catch (ResourceAccessException e) {
        throw new ResourceInitializationException(e);
    }

    Integer beamSize = AnnotatorUtil.getOptionalIntegerParameter(context,
        UimaUtil.BEAM_SIZE_PARAMETER);
View Full Code Here

            (ChunkerModelResource) context.getResourceObject(UimaUtil.MODEL_PARAMETER);
       
        model = modelResource.getModel();
    }
    catch (ResourceAccessException e) {
        throw new ResourceInitializationException(e);
    }
   
    mChunker = new ChunkerME(model);
  }
View Full Code Here

          .getResourceAsStream(context, modelName);
     
      nameFinderDictionary = new Dictionary(inModel);

    } catch (IOException e) {
      throw new ResourceInitializationException(
        ExceptionMessages.MESSAGE_CATALOG,
        ExceptionMessages.IO_ERROR_DICTIONARY_READING,
        new Object[] {e.getMessage()});
    }
   
View Full Code Here

  public static InputStream getOptionalResourceAsStream(UimaContext context,
        String name) throws ResourceInitializationException {
      try {
        return context.getResourceAsStream(name);
      } catch (ResourceAccessException e) {
        throw new ResourceInitializationException(
            ResourceInitializationException.STANDARD_MESSAGE_CATALOG,
            new Object[] { "There is an internal error in the UIMA SDK: " +
            e.getMessage(),
            e });
      }  
View Full Code Here

      String name) throws ResourceInitializationException {
   
    InputStream inResource = getOptionalResourceAsStream(context, name);
   
    if (inResource == null) {
      throw new ResourceInitializationException(
          ResourceAccessException.STANDARD_MESSAGE_CATALOG,
          new Object[] { "Unable to load resource!" });
    }

    return inResource;
View Full Code Here

  public static Type getType(TypeSystem typeSystem, String name)
      throws ResourceInitializationException {
    Type type = getOptionalType(typeSystem, name);
   
    if (type == null) {
      throw new ResourceInitializationException(
          ResourceInitializationException.INCOMPATIBLE_RANGE_TYPES,
          new Object[] { "Unable to retrieve " + name + " type!" });
    }
   
    return type;
View Full Code Here

  private static void checkForNull(Object value, String parameterName)
      throws ResourceInitializationException{
   
    if (value == null) {
      throw new ResourceInitializationException(
          ResourceInitializationException.STANDARD_MESSAGE_CATALOG,
          new Object[] { "The " + parameterName + " is a " +
          "required parameter!" });
    }
  }
View Full Code Here

    }
    else if (value instanceof String) {
      return (String) value;
    }
    else {
      throw new ResourceInitializationException(
          ResourceInitializationException.STANDARD_MESSAGE_CATALOG,
          new Object[] {"The parameter: "  + parameter + " does not have" +
          " the expected type String"});
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.ResourceInitializationException

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.