Package org.apache.uima.simpleserver.config

Examples of org.apache.uima.simpleserver.config.TypeMap


        filter = readFilter(filterBean.getFilter());
      }
    }

    // create a type map with the given information
    TypeMap typeMap = ConfigFactory.newTypeMap(typeBean.getName(), filter, typeBean.getOutputTag(),
        coveredText, typeBean.getOutputAll(), typeBean.getShortDescription(), typeBean
            .getLongDescription());

    // check if for the current type output features are mapped
    if (typeBean.getOutputs() != null) {
      Outputs outputBean = typeBean.getOutputs();
      // get mapped output features
      OutputType[] outputTypes = outputBean.getOutputArray();
      for (int i = 0; i < outputTypes.length; i++) {
        // parse output feature featurePath
        List<String> featurePath = parseFeaturePath(outputTypes[i].getFeaturePath());
        Output output = ConfigFactory.newOutput(featurePath, outputTypes[i].getOutputAttribute(),
            outputTypes[i].getShortDescription(), outputTypes[i].getLongDescription());
        // add output feature to the typeMap
        typeMap.addOutput(output);
      }
    }
    return typeMap;
  }
View Full Code Here


      AnnotationFS annot = (AnnotationFS) it.get();
      if (annot.getType().equals(docAnnotationType)) {
        // Skip the document annotation
        continue;
      }
      TypeMap typeMap = this.defaultTypeMap.get(annot.getType());
      // Create a new result entry, fill with attributes and add result set.
      ResultEntryImpl resultEntry = new ResultEntryImpl(typeMap.getOutputTag(), annot.getBegin(),
          annot.getEnd());
      makeOutputs(resultEntry, annot, typeMap);
      resultEntries.add(resultEntry);
    }
  }
View Full Code Here

        createMapForType(type);
      }
    }

    private void createMapForType(Type type) {
      TypeMap tm = ConfigFactory.newTypeMap(type.getName(), null, type.getShortName(), true);
      Iterator<?> featureIt = type.getFeatures().iterator();
      while (featureIt.hasNext()) {
        Feature feat = (Feature) featureIt.next();
        if (feat.getRange().isPrimitive()) {
          ArrayList<String> path = new ArrayList<String>(1);
          path.add(feat.getShortName());
          Output out = ConfigFactory.newOutput(path, feat.getShortName(),
              "No description provided", "No description provided");
          tm.addOutput(out);
        }
      }
      this.typeMap.put(type, tm);
    }
View Full Code Here

TOP

Related Classes of org.apache.uima.simpleserver.config.TypeMap

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.