edu.washington.cs.knowitall.rule.validate
Class RuleValidator

java.lang.Object
  extended by edu.washington.cs.knowitall.rule.validate.RuleValidator
Direct Known Subclasses:
MRRuleValidator, TrivialRuleValidator

public abstract class RuleValidator
extends Object

This abstract class defines a method for validating rules. This is used in the RuleLearner.

Author:
michael

Constructor Summary
RuleValidator()
           
 
Method Summary
abstract  boolean validate(Rule rule)
          After generalizing rules, the generalizations are validated according to this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleValidator

public RuleValidator()
Method Detail

validate

public abstract boolean validate(Rule rule)
After generalizing rules, the generalizations are validated according to this method. Invalid rules are filtered out. This allows the client of RuleLearner to specify certain base rule structures that should not be generalized beyond. It also allows the client to specify certain generalization steps that are illegal. For example, you could outlaw removing the last constraint on the predicate as a generalization.
     public boolean validate(Rule rule) {
         return rule.parent == null ||
          !Iterables.isEmpty(
              rule.parent.constraints(ExtractionPart.Predicate).size()) 
          &&
          Iterables.isEmpty(
              rule.constraints(ExtractionPart.Predicate).size() == 0);
             
     }
 

Parameters:
rule -
Returns:


Copyright © 2011 University of Washington CSE. All Rights Reserved.