The comparator definition list defines each comparator that is included in a master index application. If a comparator is not included in this list, it cannot be used in the application. If you define a comparator in this list that is not provided with the Master Index Match Engine, you need to define the logic of the new comparator in Java classes (for more information, see Creating Custom Comparators for the Master Index Match Engine.
Below is an excerpt from the default comparators list file that defines two numeric comparators, Real Number Comparator and Integer Comparator. Both comparators take two parameters, and are dependent on a second comparator class named CondensedStringComparator.
<comparator description="Numerics comparator"> <className>NumericsComparator</className> <codes> <code description="Real Number Comparator" name="n[R, ]"/> <code description="Integer Comparator" name="nI" /> </codes> <params> <param description="distance/string comparison option" name="switch" type="java.lang.String"/> <param description="Spectrum of comparison" name="range" type="java.lang.Integer|java.lang.Double"/> </params> <data-sources/> <dependency-classes> <dependency-class matchfield="CSC" name="com.sun.mdm.matcher.comparators.base.CondensedStringComparator"/> </dependency-classes> <curve-adjust status="false"/> </comparator> |
The comparators are defined in XML format. The following table lists and describes each element in the XML file.
Table 3 Comparator Definition List Elements
Element |
Attribute |
Description |
---|---|---|
group |
An element that contains a list of comparators that all share the same Java package. |
|
description |
A brief description of the comparator group. |
|
path |
The Java package that contains the code that defines the comparators in the group. |
|
comparator |
A definition for one subgroup of comparators that are all based on the same Java class, have the same Java class dependencies, accept the same parameters and data sources, and have the same curve adjustment setting. |
|
description |
A brief description of the comparator subgroup. |
|
className |
The name of the class that defines the logic for the comparators. The class must be contained in the package specified for the group element, as described above. |
|
codes |
A container element for a list of the comparators in the subgroup, with descriptions and processing codes of each comparator. |
|
code |
A description and processing code for one comparator. |
|
description |
A description of the comparator. The value you specify here appears in the comparator drop-down list on the Master Index Configuration Editor. |
|
name |
A unique identifying name for the comparator. These are the comparator names used in the rules definitions in the match configuration file (matchConfigFile.cfg). |
|
params |
A container element for a list of static parameters for the subgroup of comparators. Parameters are optional. |
|
param |
One parameter definition for the comparators. |
|
description |
A brief description of the parameter. |
|
name |
A short name for the parameter. |
|
type |
The Java data type of the values that can be specified for the parameter. |
|
data-sources |
A container element for a list of data files that contain additional information for the subgroup of comparators. For example, a comparator that generates weights based on the distance between postal codes might use lookup files containing information about the zip codes. Data sources are optional. |
|
data-source |
A definition for one data source. Currently, only file data sources are supported. |
|
description |
A brief description of the data source. |
|
name |
The complete path and filename of the data source. |
|
type |
The type of data source being used. Currently, the only value you can specify is “java.io.File”. |
|
dependency-classes |
A container element that defines a list of Java classes on which the comparator class is dependent. The current comparator class inherits from the comparator classes you specify here as well as all the match fields (defined in matchConfigFile.cfg) that use that comparator. |
|
dependency-class |
A definition for one comparator class, called a dependency comparator, on which the current comparator class is dependent. |
|
matchField |
The name of the dependency comparator's match field. |
|
name |
The name of the dependency comparator class. |
|
curve-adjust |
An indicator of whether to apply special adjustments to the weighting curve. The curve adjustment is defined for each comparator individually in a Java class named comparator_nameCurveAdjustor. |
|
status |
The status of the curve adjustor. Specify true to use the curve adjustor; specify false to disable the curve adjustor. |