Class CognateQueryDef


  • public class CognateQueryDef
    extends TextQueryDef
    Definition of a Simple query. Holds all parameters to create a Cognate NetricsQuery object.
    • Constructor Detail

      • CognateQueryDef

        public CognateQueryDef​(java.util.List<ANetricsQueryBuilderBuilderBase.CognateQueryField> fields)
        Creates a Cognate query definition.
        Parameters:
        fields - - the fields the cognate query is to query. Not null. The field names are the default output field names. This contains the data specification for each field.
        Throws:
        java.lang.IllegalArgumentException - if fields is null or zero length or contains nulls.
    • Method Detail

      • nonCogWeight

        public CognateQueryDef nonCogWeight​(java.lang.Double nonCogWeight)
        Parameters:
        nonCogWeight - the non-cognate penalty factor for this cognate query. If null or not specified this must default to 1.0.
        Throws:
        java.lang.IllegalArgumentException - if non cognate weight is given and not between 0.0 and 1.0.
      • getNonCogWeight

        public java.util.Optional<java.lang.Double> getNonCogWeight()
        Returns:
        the non-cognate penalty factor, or empty Optional if the default is used.
      • emptyFieldPenalty

        public CognateQueryDef emptyFieldPenalty​(java.lang.Double emptyFieldPenalty)
        Parameters:
        emptyFieldPenalty - - the empty field penalty factor. If null or not specified the full penalty is applied.
        Throws:
        java.lang.IllegalArgumentException - if empty field penalty is given and not between 0.0 and 1.0.
      • getEmptyFieldPenalty

        public java.util.Optional<java.lang.Double> getEmptyFieldPenalty()
        Returns:
        the the empty field penalty, or empty Optional if the default 1.0 should be used.