Package org.apache.uima.resource.metadata

Examples of org.apache.uima.resource.metadata.TypePriorities


  protected TypeSystemDescription getTypeSystemDescription() {
    return editor.getTypeSystemDescription();
  }

  protected TypePriorities getTypePriorities() {
    TypePriorities tps = getAnalysisEngineMetaData().getTypePriorities();
    if (null == tps) {
      getAnalysisEngineMetaData().setTypePriorities(
              tps = UIMAFramework.getResourceSpecifierFactory().createTypePriorities());
    }
    return tps;
View Full Code Here


      TypeDescription enumType = typeSystem.addType("EnumType", "Test Enumerated Type",
              "uima.cas.String");
      enumType.setAllowedValues(new AllowedValue[] { new AllowedValue_impl("One", "First Value"),
          new AllowedValue_impl("Two", "Second Value") });

      TypePriorities typePriorities = new TypePriorities_impl();
      TypePriorityList priorityList = typePriorities.addPriorityList();
      priorityList.addType("Fake");
      priorityList.addType("EnumType");

      FsIndexDescription index = new FsIndexDescription_impl();
      index.setLabel("testIndex");
View Full Code Here

      TypeDescription enumType = typeSystem.addType("EnumType", "Test Enumerated Type",
              "uima.cas.String");
      enumType.setAllowedValues(new AllowedValue[] { new AllowedValue_impl("One", "First Value"),
          new AllowedValue_impl("Two", "Second Value") });

      TypePriorities typePriorities = new TypePriorities_impl();
      TypePriorityList priorityList = typePriorities.addPriorityList();
      priorityList.addType("Fake");
      priorityList.addType("EnumType");

      FsIndexDescription index = new FsIndexDescription_impl();
      index.setLabel("testIndex");
View Full Code Here

      TypeDescription enumType = typeSystem.addType("EnumType", "Test Enumerated Type",
              "uima.cas.String");
      enumType.setAllowedValues(new AllowedValue[] { new AllowedValue_impl("One", "First Value"),
          new AllowedValue_impl("Two", "Second Value") });

      TypePriorities typePriorities = new TypePriorities_impl();
      TypePriorityList priorityList = typePriorities.addPriorityList();
      priorityList.addType("Fake");
      priorityList.addType("EnumType");

      FsIndexDescription index = new FsIndexDescription_impl();
      index.setLabel("testIndex");
View Full Code Here

  /**
   * used when hovering
   */
  protected String getDescriptionFromImport(String source) throws InvalidXMLException, IOException {
    TypePriorities parsedImportItem = UIMAFramework.getXMLParser().parseTypePriorities(
            new XMLInputSource(source));
    return parsedImportItem.getDescription();
  }
View Full Code Here

  }

  // indexes are checked and merged when the CAS is built
  protected boolean isValidImport(String title, String message) {
    CAS savedCAS = editor.getCurrentView();
    TypePriorities savedTP = editor.getMergedTypePriorities();
    if (null != savedTP)
      savedTP = (TypePriorities) savedTP.clone();
    try {
      editor.setMergedTypePriorities();
      editor.descriptorCAS.validate();
    } catch (ResourceInitializationException e1) {
      revertMsg(title, message, editor.getMessagesToRootCause(e1));
View Full Code Here

      typePriorityImportSection = editor.getIndexesPage().getTypePriorityImportSection();

    super.refresh();
    tree.removeAll();

    TypePriorities typePriorities = getTypePriorities();

    if (typePriorities != null) {
      TypePriorityList[] priorityLists = typePriorities.getPriorityLists();
      for (int i = 0; i < priorityLists.length; i++) {
        TreeItem item = new TreeItem(tree, SWT.NONE);
        item.setText(PRIORITY_LIST);
        String[] types = priorityLists[i].getTypes();
        if (null != types) {
View Full Code Here

  public void handleEvent(Event event) {
    if (event.widget == addSetButton) {
      TypePriorityList typePriorityList = UIMAFramework.getResourceSpecifierFactory()
              .createTypePriorityList();

      TypePriorities typePriorities = getTypePriorities();
      if (typePriorities == null) {
        typePriorities = UIMAFramework.getResourceSpecifierFactory().createTypePriorities();
        getAnalysisEngineMetaData().setTypePriorities(typePriorities);
      }
View Full Code Here

      if (md.getFsIndexCollection() != null)
        fsIndexes.add(md.getFsIndexCollection());
    }

    // merge TypePriorities and FsIndexes
    TypePriorities aggTypePriorities = CasCreationUtils.mergeTypePriorities(typePrioritiesList,
            aResourceManager);
    FsIndexCollection aggIndexColl = CasCreationUtils.mergeFsIndexes(fsIndexes, aResourceManager);
    TypeSystemDescription aggTypeDesc = CasCreationUtils.mergeTypeSystems(typeSystems,
            aResourceManager);
View Full Code Here

   *      component instances?</a>
   */
  public static AnalysisEngine createEngine(Class<? extends AnalysisComponent> componentClass,
          TypeSystemDescription typeSystem, String[] typePriorities, Object... configurationData)
          throws ResourceInitializationException {
    TypePriorities tp = null;
    if (typePriorities != null) {
      tp = TypePrioritiesFactory.createTypePriorities(typePriorities);
    }
    return createEngine(componentClass, typeSystem, tp, configurationData);
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.metadata.TypePriorities

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.