Class AnnotationPositionInDocumentC

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

    public class AnnotationPositionInDocumentC
    extends Object
    implements edu.upf.taln.ml.feat.base.FeatCalculator<Double,​gate.Annotation,​DocumentCtx>
    Get a Double from 0 to 100 that reflects the position of the annotation (central offset ID) with respect to the whole document.
    • Constructor Summary

      Constructors 
      Constructor Description
      AnnotationPositionInDocumentC​(boolean includeAbstractSentences, boolean includeContentSentences, Integer folderNumber, boolean unequal)
      If folderNumber is greater than 0, the document length is divided in folderNumber different folders of equal size and the id from 1 to folderNumber equal to the folder where the annotation is placed is returned If unequal is true the document is divided into 20 equal sized folders (folderNumber = 20) and a number from 1 to 10 is returned if (original number ---> returned number): 1 ---> 1 2 ---> 2 3 ---> 3 4 ---> 4 5 ---> 5 6 ---> 5 7 ---> 6 8 ---> 6 9 ---> 6 10 ---> 6 11 ---> 6 12 ---> 6 13 ---> 6 14 ---> 6 15 ---> 6 16 ---> 7 17 ---> 7 18 ---> 8 19 ---> 9 20 ---> 10 (SEE pag.
    • Constructor Detail

      • AnnotationPositionInDocumentC

        public AnnotationPositionInDocumentC​(boolean includeAbstractSentences,
                                             boolean includeContentSentences,
                                             Integer folderNumber,
                                             boolean unequal)
        If folderNumber is greater than 0, the document length is divided in folderNumber different folders of equal size and the id from 1 to folderNumber equal to the folder where the annotation is placed is returned If unequal is true the document is divided into 20 equal sized folders (folderNumber = 20) and a number from 1 to 10 is returned if (original number ---> returned number): 1 ---> 1 2 ---> 2 3 ---> 3 4 ---> 4 5 ---> 5 6 ---> 5 7 ---> 6 8 ---> 6 9 ---> 6 10 ---> 6 11 ---> 6 12 ---> 6 13 ---> 6 14 ---> 6 15 ---> 6 16 ---> 7 17 ---> 7 18 ---> 8 19 ---> 9 20 ---> 10 (SEE pag. 180 of: http://www.cl.cam.ac.uk/~sht25/thesis/t.pdf)
        Parameters:
        folderNumber -
        unequal -
        includeAbstractSentences -
        includeContentSentences -
    • Method Detail

      • calculateFeature

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

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