Class FieldMatchMetricsParameters


  • public final class FieldMatchMetricsParameters
    extends Object
    The parameters to a string match metric calculator. Mutable until frozen.
    Author:
    bratseth
    • Constructor Detail

      • FieldMatchMetricsParameters

        public FieldMatchMetricsParameters()
        Creates an unfrozen marcg metrics object initialized to the default values
    • Method Detail

      • setProximityLimit

        public void setProximityLimit​(int proximityLimit)
        Sets the maximum allowed gap within a segment. Default: 10
      • getProximityLimit

        public int getProximityLimit()
        Returns the maximum allowed gap within a segment. Default: 10
      • setProximityTable

        public void setProximityTable​(float[] proximityTable)
        Sets the proximity table deciding the importance of separations of various distances, The table must have size proximityLimit*2+1, where the first half is for reverse direction distances. The table must only contain values between 0 and 1, where 1 is "perfect" and 0 is "worst".
      • getProximityTable

        public float[] getProximityTable()
        Returns the current proxmity table. The default table is calculated by 1/2^(n/2) on the right order side, and 1/2^(n/2) /3 on the reverse order side where n is the distance between the tokens.
      • getProximity

        public float getProximity​(int index)
        Returns the proximity table value at an index
      • getMaxAlternativeSegmentations

        public int getMaxAlternativeSegmentations()
        Returns the maximal number of alternative segmentations allowed in addition to the first one found. Default is 10000. This will prefer to not consider iterations on segments that are far out in the field, and which starts late in the query.
      • setMaxAlternativeSegmentations

        public void setMaxAlternativeSegmentations​(int maxAlternativeSegmentations)
      • getMaxOccurrences

        public int getMaxOccurrences()
        Returns the number of occurrences the number of occurrences of each word is normalized against. This should be set as the number above which additional occurrences of the term has no real significance. The default is 100.
      • setMaxOccurrences

        public void setMaxOccurrences​(int maxOccurrences)
      • getFieldCompletenessImportance

        public float getFieldCompletenessImportance()
        Returns a number between 0 and 1 which determines the importancy of field completeness in relation to query completeness in the match and completeness metrics. Default is 0.05
      • setFieldCompletenessImportance

        public void setFieldCompletenessImportance​(float fieldCompletenessImportance)
      • getProximityCompletenessImportance

        public float getProximityCompletenessImportance()
        Returns the importance of the match having high proximity and being complete, relative to segmentProximityImportance, occurrenceImportance and earlinessImportance in the match metric. Default: 0.9
      • setProximityCompletenessImportance

        public void setProximityCompletenessImportance​(float proximityCompletenessImportance)
      • getEarlinessImportance

        public float getEarlinessImportance()
        Returns the importance of the match occuring early in the query, relative to segmentProximityImportance, occurrenceImportance and proximityCompletenessImportance in the match metric. Default: 0.05
      • setEarlinessImportance

        public void setEarlinessImportance​(float earlinessImportance)
      • getSegmentProximityImportance

        public float getSegmentProximityImportance()
        Returns the importance of multiple segments being close to each other, relative to earlinessImportance, occurrenceImportance and proximityCompletenessImportance in the match metric. Default: 0.05
      • setSegmentProximityImportance

        public void setSegmentProximityImportance​(float segmentProximityImportance)
      • getOccurrenceImportance

        public float getOccurrenceImportance()
        Returns the importance of having many occurrences of the query terms, relative to earlinessImportance, segmentProximityImportance and proximityCompletenessImportance in the match metric. Default: 0.05
      • setOccurrenceImportance

        public void setOccurrenceImportance​(float occurrenceImportance)
      • getRelatednessImportance

        public float getRelatednessImportance()
        Returns the normalized importance of relatedness used in the match metric. Default: 0.9
      • setRelatednessImportance

        public void setRelatednessImportance​(float relatednessImportance)
      • freeze

        public void freeze()
        Freezes this object. All changes after this point will cause an IllegalStateException. This must be frozen before being handed to a calculator.
        Throws:
        IllegalStateException - if this parameter object is inconsistent. In this case, this is not frozen.