public class BasicTupleMatcher extends AbstractTupleMatcher
scoreConcepts(charger.obj.Concept, charger.obj.Concept)
Modifier and Type | Field and Description |
---|---|
String |
nonAlphaNumericRegex |
conceptMatcher
Constructor and Description |
---|
BasicTupleMatcher()
Instantiate a new tuple matcher with the default concept matcher.
|
BasicTupleMatcher(AbstractConceptMatcher matcher)
Instantiate a new tuple matcher with the given concept matcher.
|
Modifier and Type | Method and Description |
---|---|
float |
compare(BinaryTuple masterTuple,
BinaryTuple tupleToMatch)
Perform a possible comparison between two tuples.
|
String |
explainYourself()
Explains the basic matcher's rules:
Gather together all relations as binary relation tuples (n-ary
relations are split).
|
boolean |
generousStringMatch(String ss1,
String ss2)
Applies an optimistic algorithm to matching strings:
Ignore any characters other than [a-zA-Z0-9]
Ignore differences in upper or lower case
Accept if either is a substring of the other.
|
protected float |
scoreConcepts(Concept c1,
Concept c2)
Calculates a "score" for matching two Charger concepts.
|
float |
scoreTupleMatch(MatchedBinaryTuple masterTuple,
MatchedBinaryTuple tupleToMatch)
Determines the matching score for the pair of tuples given.
|
bullet, getConceptMatcher, setConceptMatcher
isIgnoreCase, isVerboseEnabled, setIgnoreCase, setVerboseEnabled
public BasicTupleMatcher()
AbstractTupleMatcher
public BasicTupleMatcher(AbstractConceptMatcher matcher)
public float compare(BinaryTuple masterTuple, BinaryTuple tupleToMatch)
AbstractTupleMatcher
compare
in class AbstractTupleMatcher
masterTuple
- the relation tuple considered to be the "correct" one (if any)tupleToMatch
- the candidate tuple that we want to match to the master.AbstractTupleMatcher.scoreTupleMatch(kb.matching.MatchedBinaryTuple, kb.matching.MatchedBinaryTuple)
public float scoreTupleMatch(MatchedBinaryTuple masterTuple, MatchedBinaryTuple tupleToMatch)
scoreTupleMatch
in class AbstractTupleMatcher
MatchedBinaryTuple
public String explainYourself()
explainYourself
in class AbstractMatcher
protected float scoreConcepts(Concept c1, Concept c2)
c1
- c2
- generousStringMatch(java.lang.String, java.lang.String)
public boolean generousStringMatch(String ss1, String ss2)