Package org.apache.uima.cas

Examples of org.apache.uima.cas.Feature


  @Override
  public List<Feature> getFeatures(RutaBlock parent) {
    List<Feature> result = new ArrayList<Feature>();
    Type type = typeExpr.getType(parent);
    Feature feature = null;
    for (String each : features) {
      feature = type.getFeatureByBaseName(each);
      result.add(feature);
      type = feature.getRange();
    }
    return result;
  }
View Full Code Here


            .getType("org.apache.uima.examples.SourceDocumentInformation");
    if (sdiType != null) {
      if (cas.getAnnotationIndex(sdiType).size() == 0) {
        AnnotationFS sdi = cas.createAnnotation(sdiType, cas.getDocumentAnnotation().getBegin(),
                cas.getDocumentAnnotation().getEnd());
        Feature uriFeature = sdiType.getFeatureByBaseName("uri");
        sdi.setStringValue(uriFeature, each.toURI().getPath());
        cas.addFsToIndexes(sdi);
      }
    }
  }
View Full Code Here

      Vector featureTypes = type.getAppropriateFeatures();

      Iterator featuresItertor = featureTypes.iterator();

      while (featuresItertor.hasNext()) {
        Feature feature = (Feature) featuresItertor.next();

        if (Primitives.isPrimitive(feature)) {
          // create a new pair
          // feature and value
          // add string
View Full Code Here

    AnnotationSelection annotations = new AnnotationSelection(getStructuredSelection());

    AnnotationFS annotation = annotations.getFirst();

    Type annotationType = annotation.getType();
    Feature endFeature = annotationType.getFeatureByBaseName("end");

    if (annotation.getBegin() < annotation.getEnd()) {
      annotation.setIntValue(endFeature, annotation.getEnd() - 1);
    }
View Full Code Here

    AnnotationSelection annotations = new AnnotationSelection(getStructuredSelection());

    AnnotationFS annotation = annotations.getFirst();

    Type annotationType = annotation.getType();
    Feature endFeature = annotationType.getFeatureByBaseName("end");

    if (annotation.getEnd() < mDocument.getText().length()) {
      annotation.setIntValue(endFeature, annotation.getEnd() + 1);
    }
View Full Code Here

    AnnotationSelection annotations = new AnnotationSelection(getStructuredSelection());

    AnnotationFS annotation = annotations.getFirst();

    Type annotationType = annotation.getType();
    Feature beginFeature = annotationType.getFeatureByBaseName("begin");

    if (annotation.getBegin() < annotation.getEnd()) {
      annotation.setIntValue(beginFeature, annotation.getBegin() + 1);
    }
View Full Code Here

    AnnotationSelection annotations = new AnnotationSelection(getStructuredSelection());

    AnnotationFS annotation = annotations.getFirst();

    Type annotationType = annotation.getType();
    Feature beginFeature = annotationType.getFeatureByBaseName("begin");

    if (annotation.getBegin() > 0) {
      annotation.setIntValue(beginFeature, annotation.getBegin() - 1);
    }
View Full Code Here

        Collection<FeatureValue> featureValues = new LinkedList<FeatureValue>();

        Iterator featuresItertor = featureTypes.iterator();

        while (featuresItertor.hasNext()) {
          Feature feature = (Feature) featuresItertor.next();

          featureValues.add(new FeatureValue(mDocument, featureStructure, feature));
        }

        return featureValues.toArray();
View Full Code Here

  }
 
  public static Feature getRequiredFeature(Type type, String featureName)
      throws AnalysisEngineProcessException {

    Feature feature = type.getFeatureByBaseName(featureName);

    if (feature == null) {
      throw new OpenNlpAnnotatorProcessException(
          ExceptionMessages.FEATURE_NOT_FOUND, new Object[] { type.getName(),
              featureName});
View Full Code Here

   * @throws AnnotatorConfigurationException
   */
  public static Feature getRequiredFeature(Type type, String featureName,
      String rangeType) throws AnalysisEngineProcessException {

    Feature feature = getRequiredFeature(type, featureName);

    checkFeatureType(feature, rangeType);

    return feature;
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.cas.Feature

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.