All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gate.creole.orthomatcher.MatchRule0 Maven / Gradle / Ivy

Go to download

ANNIE is a general purpose information extraction system that provides the building blocks of many other GATE applications.

There is a newer version: 9.1
Show newest version
package gate.creole.orthomatcher;



/** RULE #0: If the two names are listed in table of
 * spurius matches then they do NOT match
 * Condition(s): -
 * Applied to: all name annotations
 */
public class MatchRule0 implements OrthoMatcherRule {
 
    OrthoMatcher orthomatcher;
	
	  public MatchRule0(OrthoMatcher orthmatcher){
		   this.orthomatcher=orthmatcher;
	  }
	 
	  @Override
    public boolean value(String string1,String string2){
		 
	      boolean result=false;
	    
	      if (orthomatcher.spur_match.containsKey(string1)
	            && orthomatcher.spur_match.containsKey(string2) )
	      result=
	      orthomatcher.spur_match.get(string1).toString().equals(orthomatcher.spur_match.get(string2).toString());

	      if (result) OrthoMatcherHelper.usedRule(0);
	      
	      return result;
	  }
	  
	  @Override
    public String getId(){
	    return "MatchRule0";
	  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy