Class PersonNameFeature


  • public final class PersonNameFeature
    extends Feature<com.tibco.patterns.learn.jaxb.model.PersonNameFeatureType>
    A feature with 3 querylets:
    Simple: first name, with thesaurus;
    Simple: last name;
    Cognate: first, middle (optional) and last name fields, with thesaurus, non-cognate weight 0.8, empty field penalty 0.1.
    The first name thesaurus is optional, but should be assigned to this feature.
    • Constructor Detail

      • PersonNameFeature

        public PersonNameFeature​(java.lang.String name,
                                 int fNameIndex,
                                 int mNameIndex,
                                 int lNameIndex,
                                 java.util.List<java.lang.String> allFields)
        Creates a new feature for first, middle and last names.
        Parameters:
        name - - the name of the feature. Not null.
        fNameIndex - - index of first name field in the list of all fields
        mNameIndex - - index of middle name field in the list of all fields. A negative value indicates that middle name field is not used.
        lNameIndex - - index of last name field in the list of all fields
        allFields - - all non-key fields in the data table.
        Throws:
        java.lang.IllegalArgumentException - if First or Last name index is negative, or if any two indexes refer to the same field.
      • PersonNameFeature

        public PersonNameFeature​(java.lang.String name,
                                 int fNameIndex,
                                 int lNameIndex,
                                 java.util.List<java.lang.String> allFields)
        Creates a new feature for first and last names (middle name field is not used).
        See Also:
        PersonNameFeature(String, int, int, int, List)
    • Method Detail

      • getFNameField

        public java.lang.String getFNameField()
        Returns:
        the first name field
      • getMNameField

        public java.lang.String getMNameField()
        Returns:
        the middle name field, or null if middle name field is not used in this feature.
      • getLNameField

        public java.lang.String getLNameField()
        Returns:
        the last name field
      • getThesaurusName

        public java.lang.String getThesaurusName()
        Returns:
        thesaurus name, or null if thesaurus is not assigned
      • getThesaurusWeight

        public double getThesaurusWeight()
        Returns:
        thesaurus weight, or 1.0 if thesaurus is not assigned. getThesaurusName() should be used first to check if the thesaurus is assigned.
      • getFieldNames

        public java.util.List<java.lang.String> getFieldNames()
        Overrides:
        getFieldNames in class Feature<com.tibco.patterns.learn.jaxb.model.PersonNameFeatureType>
        Returns:
        a list of fields used in this feature.