Package org.apache.uima.analysis_engine

Examples of org.apache.uima.analysis_engine.TypeOrFeature


    }
    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

     *          the CAS to check against
     * @return true iff the input requirements are satisfied
     */
    private boolean inputsSatisfied(TypeOrFeature[] aInputs, CAS aCAS) {
      for (int i = 0; i < aInputs.length; i++) {
        TypeOrFeature input = aInputs[i];
        if (input.isType()) {
          Type type = aCAS.getTypeSystem().getType(input.getName());
          if (type == null)
            return false;
          Iterator iter = aCAS.getIndexRepository().getAllIndexedFS(type);
          if (!iter.hasNext())
            return false;
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

    setTypeSystem(aTypeSystem);
    compile();
  }
   
  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

  private static final Feature f4 = ts.addFeature("F4", t4, t4);
  static {ts.commit();};
 
  // TypeOrFeature instances
  private static TypeOrFeature makeTof(String name, boolean isType, boolean allFeats) {
    TypeOrFeature r = new TypeOrFeature_impl();
    r.setName(name);
    r.setType(isType);
    r.setAllAnnotatorFeatures(allFeats);
    return r;
  }
View Full Code Here

     *          the CAS to check against
     * @return true iff the input requirements are satisfied
     */
    private boolean inputsSatisfied(TypeOrFeature[] aInputs, CAS aCAS) {
      for (int i = 0; i < aInputs.length; i++) {
        TypeOrFeature input = aInputs[i];
        if (input.isType()) {
          Type type = aCAS.getTypeSystem().getType(input.getName());
          if (type == null)
            return false;
          Iterator iter = aCAS.getIndexRepository().getAllIndexedFS(type);
          if (!iter.hasNext())
            return false;
View Full Code Here

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

    TypeOrFeature[] oldArr = getInputs();
    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.analysis_engine.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.analysis_engine.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

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.