Class DERIV_RelativePositionOfFirstMatchOfAnnotationNominalC

  • All Implemented Interfaces:
    edu.upf.taln.ml.feat.base.FeatCalculator<String,​gate.Annotation,​DocumentCtx>

    public class DERIV_RelativePositionOfFirstMatchOfAnnotationNominalC
    extends Object
    implements edu.upf.taln.ml.feat.base.FeatCalculator<String,​gate.Annotation,​DocumentCtx>
    Get the sentence relative position of the first match of a certain annotation
    • Constructor Detail

      • DERIV_RelativePositionOfFirstMatchOfAnnotationNominalC

        public DERIV_RelativePositionOfFirstMatchOfAnnotationNominalC​(String tokenAnnotationSet,
                                                                      String tokenAnnotationName,
                                                                      String featureFilterName,
                                                                      String featureFilterValue,
                                                                      boolean featureFilterStartsWith)
        The annotation set and the annotation name to check for intersection with the main annotation. The three arguments that have a name starting with fratureFilter are devoted to filter by a feature name and value the annotations to consider. If featureFilterName is null or empty no filter is performed. If featureFilterName is not null or empty, only annotations having a feature with that name are considered. If also featureFilterValue is not null or empty, only annotations having a feature name equal to featureFilterName and a feature value equal to featureFilterValue are considered. If featureFilterStartsWith is true, it is only checked that the feature value starts with the featureFilterValue string.
        Parameters:
        caseInsensitiveMatch -
        tokenAnnotationSet -
        tokenAnnotationName -
        featureFilterName -
        featureFilterValue -
        featureFilterStartsWith -
    • Method Detail

      • calculateFeature

        public edu.upf.taln.ml.feat.base.MyString calculateFeature​(gate.Annotation obj,
                                                                   DocumentCtx doc,
                                                                   String featName)
        Specified by:
        calculateFeature in interface edu.upf.taln.ml.feat.base.FeatCalculator<String,​gate.Annotation,​DocumentCtx>
      • round

        public static double round​(double value,
                                   int places)