com.aliasi.coref
Class BooleanMatcherAdapter
java.lang.Object
com.aliasi.coref.BooleanMatcherAdapter
- All Implemented Interfaces:
- Matcher
- Direct Known Subclasses:
- EntityTypeMatch, ExactPhraseMatch, SequenceSubstringMatch, SynonymMatch
public abstract class BooleanMatcherAdapter
- extends Object
- implements Matcher
Provides a means of implementing a Matcher that returns a
constant value if a boolean condition is satisifed and the no-match
score otherwise. The constructor provides the constant score for a
match, and the logic is provided through an implementation of
the method matchBoolean(Mention,MentionChain) by a subclass.
- Since:
- LingPipe1.0
- Version:
- 1.0
- Author:
- Bob Carpenter
|
Constructor Summary |
BooleanMatcherAdapter(int score)
Construct a boolean matcher adapter that returns the
specified score. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BooleanMatcherAdapter
public BooleanMatcherAdapter(int score)
- Construct a boolean matcher adapter that returns the
specified score.
- Parameters:
score - Score to return if there is a match.
matchBoolean
public abstract boolean matchBoolean(Mention mention,
MentionChain mentionChain)
- Returns
true if the specified mention matches
the specified mention chain.
- Parameters:
mention - Mention to compare for possible coreference.mentionChain - Mention chain to compare for possible
coreference.
- Returns:
true if the mention matches the mention
chain according to this matching function.
match
public final int match(Mention mention,
MentionChain mentionChain)
- Final implementation of the matching function required by
Matcher. Returns the constant
specified in the constructor if matchBoolean(Mention,MentionChain) returns true
and returns Matcher.NO_MATCH_SCORE
otherwise.
- Specified by:
match in interface Matcher
- Parameters:
mention - Mention to compare for possible coreference.mentionChain - Mention chain to compare for possible
coreference.
- Returns:
- Constant supplied in constructor if there is a match
and the no-match score otherwise.