Package org.apache.uima.analysis_engine

Examples of org.apache.uima.analysis_engine.TypeOrFeature


  /**
   * @see org.apache.uima.resource.metadata.Capability#addInputFeature(java.lang.String)
   */
  public void addInputFeature(String aFeatureName) {
    TypeOrFeature feat = UIMAFramework.getResourceSpecifierFactory().createTypeOrFeature();
    feat.setType(false);
    feat.setName(aFeatureName);

    TypeOrFeature[] oldArr = getInputs();
    TypeOrFeature[] newArr = new TypeOrFeature[oldArr.length + 1];
    System.arraycopy(oldArr, 0, newArr, 0, oldArr.length);
    newArr[newArr.length - 1] = feat;
View Full Code Here


  /**
   * @see org.apache.uima.resource.metadata.Capability#addOutputType(java.lang.String,
   *      boolean)
   */
  public void addOutputType(String aTypeName, boolean aAllAnnotatorFeatures) {
    TypeOrFeature type = UIMAFramework.getResourceSpecifierFactory().createTypeOrFeature();
    type.setType(true);
    type.setName(aTypeName);
    type.setAllAnnotatorFeatures(aAllAnnotatorFeatures);

    TypeOrFeature[] oldArr = getOutputs();
    TypeOrFeature[] newArr = new TypeOrFeature[oldArr.length + 1];
    System.arraycopy(oldArr, 0, newArr, 0, oldArr.length);
    newArr[newArr.length - 1] = type;
View Full Code Here

  /**
   * @see org.apache.uima.resource.metadata.Capability#addOutputFeature(java.lang.String)
   */
  public void addOutputFeature(String aFeatureName) {
    TypeOrFeature feat = UIMAFramework.getResourceSpecifierFactory().createTypeOrFeature();
    feat.setType(false);
    feat.setName(aFeatureName);

    TypeOrFeature[] oldArr = getOutputs();
    TypeOrFeature[] newArr = new TypeOrFeature[oldArr.length + 1];
    System.arraycopy(oldArr, 0, newArr, 0, oldArr.length);
    newArr[newArr.length - 1] = feat;
View Full Code Here

    new TableColumn(table, SWT.NONE).setText("Input");
    new TableColumn(table, SWT.NONE).setText("Output");

    TableItem item = new TableItem(table, SWT.NONE);
    item.setText(0, CapabilitySection.ALL_FEATURES);
    TypeOrFeature tof = CapabilitySection.getTypeOrFeature(capability.getInputs(), selectedType
            .getName());
    setChecked(item, 1, null == tof ? false : tof.isAllAnnotatorFeatures());
    tof = CapabilitySection.getTypeOrFeature(capability.getOutputs(), selectedType.getName());
    setChecked(item, 2, null == tof ? false : tof.isAllAnnotatorFeatures());

    for (int i = 0; i < allFeatures.length; i++) {
      item = new TableItem(table, SWT.NONE);
      item.setText(0, allFeatures[i].getShortName());
      setChecked(item, 1, CapabilitySection.isInput(getTypeFeature(allFeatures[i]), capability));
View Full Code Here

      }
    } else { // existing item being edited - just show one item
      TableItem item = new TableItem(table, SWT.NONE);
      item.setText(NAME, existing.getText(CapabilitySection.NAME_COL));
      item.setText(NAMESPACE, existing.getText(CapabilitySection.NAMESPACE_COL));
      TypeOrFeature tof = CapabilitySection.getTypeOrFeature(capability.getInputs(),
              capabilitySection.getFullyQualifiedName(existing));
      setChecked(item, 1, null != tof);
      tof = CapabilitySection.getTypeOrFeature(capability.getOutputs(), capabilitySection
              .getFullyQualifiedName(existing));
      setChecked(item, 2, null != tof);
View Full Code Here

    new TableColumn(table, SWT.NONE).setText("Input");
    new TableColumn(table, SWT.NONE).setText("Output");

    TableItem item = new TableItem(table, SWT.NONE);
    item.setText(0, CapabilitySection.ALL_FEATURES);
    TypeOrFeature tof = CapabilitySection.getTypeOrFeature(capability.getInputs(), selectedType
            .getName());
    setChecked(item, 1, null == tof ? false : tof.isAllAnnotatorFeatures());
    tof = CapabilitySection.getTypeOrFeature(capability.getOutputs(), selectedType.getName());
    setChecked(item, 2, null == tof ? false : tof.isAllAnnotatorFeatures());

    for (int i = 0; i < allFeatures.length; i++) {
      item = new TableItem(table, SWT.NONE);
      item.setText(0, allFeatures[i].getShortName());
      setChecked(item, 1, CapabilitySection.isInput(getTypeFeature(allFeatures[i]), capability));
View Full Code Here

    }
    setNeedsCompilation();
  }

  private TypeOrFeature createTypeOrFeature(String name, boolean isType, boolean aAllAnnotatorFeatures) {
    TypeOrFeature r = new TypeOrFeature_impl();
    r.setType(isType);
    r.setName(name);
    if (isType) {
      r.setAllAnnotatorFeatures(aAllAnnotatorFeatures);
    }
    return r;
  }
View Full Code Here

//        typesToCompile.put(typeName, new TypeToCompile(typeName, tof.isAllAnnotatorFeatures(), tof_langs.languages));
//      }
//    }

    for (ToF_Languages tof_langs : name2tof_langs.values()) {
        TypeOrFeature tof = tof_langs.tof;
       
        addResultType(tof.getName(), tof.isAllAnnotatorFeatures(), tof_langs.languages);
       
        if (tof.isType()) {
          compileTypeRecursively(mTypeSystem.getType(tof.getName()), tof.isAllAnnotatorFeatures(), tof_langs.languages);
        }
    }
  }
View Full Code Here

      }
    } else { // existing item being edited - just show one item
      TableItem item = new TableItem(table, SWT.NONE);
      item.setText(NAME, existing.getText(CapabilitySection.NAME_COL));
      item.setText(NAMESPACE, existing.getText(CapabilitySection.NAMESPACE_COL));
      TypeOrFeature tof = CapabilitySection.getTypeOrFeature(capability.getInputs(),
              capabilitySection.getFullyQualifiedName(existing));
      setChecked(item, 1, null != tof);
      tof = CapabilitySection.getTypeOrFeature(capability.getOutputs(), capabilitySection
              .getFullyQualifiedName(existing));
      setChecked(item, 2, null != tof);
View Full Code Here

  }

  public void testAddCapabilitiesWithoutLanguage() throws Exception {
     try {
      
        TypeOrFeature t4 = new TypeOrFeature_impl();
        t4.setType(true);
        t4.setName("AnotherFakeType");
        t4.setAllAnnotatorFeatures(false);

        // capability 4 - using t4 but now language
        Capability cap4 = new Capability_impl();
        TypeOrFeature[] tofs4 = { t4 };
        cap4.setOutputs(tofs4);
View Full Code Here

TOP

Related Classes of org.apache.uima.analysis_engine.TypeOrFeature

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.