Examples of parseResourceSpecifier()


Examples of org.apache.uima.util.XMLParser.parseResourceSpecifier()

      xmlSource = (xmlDescFile != null) ? new XMLInputSource(xmlDescFile) : new XMLInputSource(
              xmlDescUrl);
      // parse XML source and create resource specifier
      ResourceSpecifier resourceSpec = null;
      try {
        resourceSpec = xmlParser.parseResourceSpecifier(xmlSource);
      } catch (UIMAException err) {
        __errTableByUri.put( xmlDescUri, err );
      } catch (UIMARuntimeException exc) {
        __errTableByUri.put( xmlDescUri, exc );
      }
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseResourceSpecifier()

    assertTrue("Descriptor must exist: " + descriptorFile.getAbsolutePath(), descriptorFile
        .exists());

    try {
      XMLParser parser = UIMAFramework.getXMLParser();
      ResourceSpecifier spec = parser.parseResourceSpecifier(new XMLInputSource(
          descriptorFile));
      // Create a new properties object to hold the settings.
      Properties performanceTuningSettings = new Properties();
      // Set the initial CAS heap size.
      performanceTuningSettings.setProperty(
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseResourceSpecifier()

    XMLInputSource xmlSource = null;
    ResourceSpecifier dlgSpecifier = null;
    try {
      xmlSource = new XMLInputSource(dlgDescPath);
      XMLParser xmlParser = UIMAFramework.getXMLParser();
      dlgSpecifier = xmlParser.parseResourceSpecifier(xmlSource);
    } catch (InvalidXMLException xmlExc) {
      String msgKey = xmlExc.getMessageKey();
      // if msg key is INVALID_CLASS, this is TS or RR desc
      if (InvalidXMLException.INVALID_CLASS.equals(msgKey))
        throw new IllegalArgumentException(xmlExc.toString());
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseResourceSpecifier()

          Object[] parameters) throws InvalidXMLException {
    ConfigurationParameterFactory.ensureParametersComeInPairs(parameters);

    ResourceCreationSpecifier specifier;
    XMLParser parser = UIMAFramework.getXMLParser();
    specifier = (ResourceCreationSpecifier) parser.parseResourceSpecifier(xmlInput);
    setConfigurationParameters(specifier, parameters);

    return specifier;
  }
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseResourceSpecifier()

    XMLInputSource xmlSource = null;
    ResourceSpecifier dlgSpecifier = null;
    try {
      xmlSource = new XMLInputSource(dlgDescPath);
      XMLParser xmlParser = UIMAFramework.getXMLParser();
      dlgSpecifier = xmlParser.parseResourceSpecifier(xmlSource);
    } catch (InvalidXMLException xmlExc) {
      String msgKey = xmlExc.getMessageKey();
      // if msg key is INVALID_CLASS, this is TS or RR desc
      if (InvalidXMLException.INVALID_CLASS.equals(msgKey))
        throw new IllegalArgumentException(xmlExc.toString());
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseResourceSpecifier()

      xmlSource = (xmlDescFile != null) ? new XMLInputSource(xmlDescFile) : new XMLInputSource(
              xmlDescUrl);
      // parse XML source and create resource specifier
      ResourceSpecifier resourceSpec = null;
      try {
        resourceSpec = xmlParser.parseResourceSpecifier(xmlSource);
      } catch (UIMAException err) {
        __errTableByUri.put( xmlDescUri, err );
      } catch (UIMARuntimeException exc) {
        __errTableByUri.put( xmlDescUri, exc );
      }
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseResourceSpecifier()

      xmlSource = (xmlDescFile != null) ? new XMLInputSource(xmlDescFile) : new XMLInputSource(
              xmlDescUrl);
      // parse XML source and create resource specifier
      ResourceSpecifier resourceSpec = null;
      try {
        resourceSpec = xmlParser.parseResourceSpecifier(xmlSource);
      } catch (UIMAException err) {
        __errTableByUri.put( xmlDescUri, err );
      } catch (UIMARuntimeException exc) {
        __errTableByUri.put( xmlDescUri, exc );
      }
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseResourceSpecifier()

  public static AnalysisEngine getAE(File analysisEngineDescriptorFile) throws ResourceInitializationException {
    try {
      XMLInputSource xmlInputSource = new XMLInputSource(analysisEngineDescriptorFile);
      XMLParser xmlParser = UIMAFramework.getXMLParser();
      ResourceSpecifier resourceSpecifier = xmlParser.parseResourceSpecifier(xmlInputSource);
      AnalysisEngine analysisEngine = UIMAFramework.produceAnalysisEngine(resourceSpecifier);
      return analysisEngine;
    } catch (IOException ioe) {
      throw new ResourceInitializationException(ioe);
    } catch (InvalidXMLException ixe) {
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseResourceSpecifier()

  public static CollectionReader getCR(File collectionReaderDescriptorFile) throws ResourceInitializationException {
    try {
      XMLInputSource xmlInputSource = new XMLInputSource(collectionReaderDescriptorFile);
      XMLParser xmlParser = UIMAFramework.getXMLParser();
      ResourceSpecifier resourceSpecifier = xmlParser.parseResourceSpecifier(xmlInputSource);
      CollectionReader collectionReader = UIMAFramework.produceCollectionReader(resourceSpecifier);
      return collectionReader;
    } catch (IOException ioe) {
      throw new ResourceInitializationException(ioe);
    } catch (InvalidXMLException ixe) {
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseResourceSpecifier()

   */
  public void testMobyDick() {
    try {
      XMLParser xmlParser = UIMAFramework.getXMLParser();
      XMLInputSource xmlInputSource = new XMLInputSource("desc/HmmTaggerAggregate.xml");
      AnalysisEngine taggerEngine = UIMAFramework.produceAnalysisEngine(xmlParser
          .parseResourceSpecifier(xmlInputSource));
      String text = null;
      try {
        text = FileUtils.file2String(new File("../uimaj-core/src/test/resources/data/moby.txt"),
            "utf-8");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.