MatchRule0.java
01 package gate.creole.orthomatcher;
02 
03 
04 import java.util.HashMap;
05 
06 /** RULE #0: If the two names are listed in table of
07  * spurius matches then they do NOT match
08  * Condition(s): -
09  * Applied to: all name annotations
10  */
11 public class MatchRule0 implements OrthoMatcherRule {
12  
13     OrthoMatcher orthomatcher;
14   
15     public MatchRule0(OrthoMatcher orthmatcher){
16        this.orthomatcher=orthmatcher;
17     }
18    
19     public boolean value(String string1,String string2){
20      
21         boolean result=false;
22       
23         if (orthomatcher.spur_match.containsKey(string1)
24               && orthomatcher.spur_match.containsKey(string2) )
25         result=
26         orthomatcher.spur_match.get(string1).toString().equals(orthomatcher.spur_match.get(string2).toString());
27 
28         if (resultOrthoMatcherHelper.usedRule(0);
29         
30         return result;
31     }
32     
33     public String getId(){
34       return "MatchRule0";
35     }
36 }