Examples of resolveImports()


Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

      }
      File tsFile = new File(tsLocation);
      XMLInputSource ints = new XMLInputSource(tsFile);
      TypeSystemDescription importTSD = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              ints);
      importTSD.resolveImports(resMgr);
      tsds.add(importTSD);
      TypeSystemDescription mergeTypeSystems = CasCreationUtils.mergeTypeSystems(tsds);
      aed.getAnalysisEngineMetaData().setTypeSystem(mergeTypeSystems);
    }
    aed.resolveImports(resMgr);
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

  public void refreshTypeSystem() {
    try {
      String typeSystem = getPathToTypeSystem();
      TypeSystemDescription tsd = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              new XMLInputSource(new File(typeSystem)));
      tsd.resolveImports();
      this.tsd = tsd;
    } catch (InvalidXMLException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

    try {
      acView = (AnnotationCheckView) HandlerUtil.getActiveWorkbenchWindow(event).getWorkbench()
              .getActiveWorkbenchWindow().getActivePage().showView(AnnotationCheckView.ID);
      AnnotationCheckComposite composite = (AnnotationCheckComposite) acView.getComposite();
      TypeSystemDescription tsd = composite.getTypeSystemDescription();
      tsd.resolveImports();
      Display display = Display.getDefault();
      Shell shell = new Shell(display);
      shell.setText("Unchecked Types");
      SelectTypesDialogCheck dialog = new SelectTypesDialogCheck(shell, tsd,
              composite.getUncheckedTypes(), false, SWT.MULTI, true);
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

   * @throws InvalidXMLException When import cannot be resolved.
   */
  private void importDeclaredTypesystems(TypeSystem casTS) throws InvalidXMLException {
    String[] descriptors = typesystems.toArray(new String[typesystems.size()]);
    TypeSystemDescription ts = TypeSystemDescriptionFactory.createTypeSystemDescription(descriptors);
    ts.resolveImports();
    for (TypeDescription td : ts.getTypes()) {
      Type type = casTS.getType(td.getName());
      if (type != null) {
        addType(type);
      } else {
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

   * @param packageName Package to load or null to load all packages.
   */
  public void importPackageFromTypeSystem(String typesystem, String packageName, String alias) {
    TypeSystemDescription tsd = TypeSystemDescriptionFactory.createTypeSystemDescription(typesystem);
    try {
      tsd.resolveImports(getResourceManager());
    } catch (InvalidXMLException e) {
      throw new RuntimeException("Cannot resolve imports in " + typesystem, e);
    }

    for (TypeDescription td : tsd.getTypes()) {
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

      }
      File tsFile = new File(tsLocation);
      XMLInputSource ints = new XMLInputSource(tsFile);
      TypeSystemDescription importTSD = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              ints);
      importTSD.resolveImports(resMgr);
      tsds.add(importTSD);
      TypeSystemDescription mergeTypeSystems = CasCreationUtils.mergeTypeSystems(tsds);
      aed.getAnalysisEngineMetaData().setTypeSystem(mergeTypeSystems);
    }
    aed.resolveImports(resMgr);
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

    } else {
      tsDesc = UIMAFramework.getXMLParser().parseTypeSystemDescription(new XMLInputSource(url));
    }

    ResourceManager resMgr = getResourceManager(classLoader);
    tsDesc.resolveImports(resMgr);
    for (TypeDescription each : tsDesc.getTypes()) {
      String longName = each.getName();
      String shortName = getShortName(longName);
      if (pkgToken != null) {
        String pkg = pkgToken.getText();
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

    TypeSystemDescription typeSysDescr = null;
    if (descriptorPath.toFile().exists()) {
      typeSysDescr = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              new XMLInputSource(descriptorPath.toPortableString()));
      ResourceManager resMgr = getResourceManager(classLoader);
      typeSysDescr.resolveImports(resMgr);
    }
    return typeSysDescr;
  }

  private String translate(String name) {
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

    Object descriptor = UIMAFramework.getXMLParser().parse(new XMLInputSource(tsUrl));
    TypeSystemDescription tsDesc = (TypeSystemDescription) descriptor;
    tsDesc.addType("uima.ruta.T1", "", "uima.tcas.Annotation");
    tsDesc.addType("uima.ruta.T2", "", "uima.tcas.Annotation");
    tsDesc.addType("uima.ruta.T3", "", "uima.tcas.Annotation");
    tsDesc.resolveImports();
    TypePriorities typePriorities = UIMAFramework.getXMLParser().parseTypePriorities(new XMLInputSource(typePrioritiesUrl));
    CAS cas = CasCreationUtils.createCas(tsDesc, typePriorities, new FsIndexDescription[0]);
   
    cas.setDocumentText("Some document.");
   
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

            .getTypeSystemDescriptorFromTMSourceFile(scriptPath);
    TypeSystemDescription defaultTypeSystemDescription = null;
    try {
      defaultTypeSystemDescription = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              new XMLInputSource(new File(defaultTypeSystemDescriptorLocation)));
      defaultTypeSystemDescription.resolveImports();
      TypeDescription[] systemTypes = defaultTypeSystemDescription.getTypes();
      for (TypeDescription typeDescription : systemTypes) {
        types.add(typeDescription.getName());
      }
      Collections.sort(types);
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.