public interface MatchKit
This interface consists of two methods. One tests whether two tuples count as matching or not, and assigns a closeness score if they are (in practice, this is likely to compare corresponding elements of the two submitted tuples allowing for some error in each one). The second is a bit more subtle: it must identify a set of bins into which possible matches for the tuple might fall. For the case of coordinate matching with errors, you would need to chop the whole possible space into a discrete set of zones, each with a given key, and return the key for each zone near enough to the submitted tuple (point) that it might contain a match for it.
Formally, the requirements for correct implementations of this interface are as follows:
It may help to think of all this as a sort of fuzzy hash.
Instances of this class are not thread-safe, and should not be used from multiple threads concurrently.
Modifier and Type | Field and Description |
---|---|
static Object[] |
NO_BINS
Convenience constant - it's a zero-length array of objects, suitable
for returning from
getBins(java.lang.Object[]) if no match can result. |
Modifier and Type | Method and Description |
---|---|
Object[] |
getBins(Object[] tuple)
Returns a set of keys for bins into which possible matches for
a given tuple might fall.
|
double |
matchScore(Object[] tuple1,
Object[] tuple2)
Indicates whether two tuples count as matching each other, and if
so how closely.
|
static final Object[] NO_BINS
getBins(java.lang.Object[])
if no match can result.Object[] getBins(Object[] tuple)
tuple
- tupledouble matchScore(Object[] tuple1, Object[] tuple2)
If there's no reason to do otherwise, the range 0..1 is recommended for successul matches. However, if the result has some sort of physical meaning (such as a distance in real space) that may be used instead.
tuple1
- one tupletuple2
- the other tupleCopyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.