01 package gate.creole.orthomatcher;
02
03 import gate.creole.ANNIEConstants;
04
05 /**
06 * RULE #16: Conservative match rule
07 * Require every token in one name to match the other except for tokens that are on a stop word list
08 */
09 public class MatchRule17 implements OrthoMatcherRule {
10
11 OrthoMatcher orthomatcher;
12
13 public MatchRule17(OrthoMatcher orthmatcher){
14 this.orthomatcher=orthmatcher;
15 }
16
17 public boolean value(String s1, String s2) {
18
19 boolean result=false;
20 OrthoMatcherHelper.usedRule(17);
21
22 //reversed execution of allNonStopTokensInOtherAnnot
23 if (orthomatcher.getOrthography().allNonStopTokensInOtherAnnot(orthomatcher.tokensLongAnnot, orthomatcher.tokensShortAnnot,ANNIEConstants.TOKEN_STRING_FEATURE_NAME,orthomatcher.caseSensitive)) {
24 result = orthomatcher.getOrthography().allNonStopTokensInOtherAnnot(orthomatcher.tokensShortAnnot, orthomatcher.tokensLongAnnot,ANNIEConstants.TOKEN_STRING_FEATURE_NAME,orthomatcher.caseSensitive);
25 }
26
27 return result;
28 }
29
30 public String getId(){
31 return "MatchRule17";
32 }
33 }
|