up
Class Rule

java.lang.Object
  extended by up.Rule
Direct Known Subclasses:
BinaryRule, PreterminalRule, UnaryRule

public abstract class Rule
extends java.lang.Object

A rule of a PCFG.


Constructor Summary
Rule()
          Constructs a new rule.
 
Method Summary
abstract  int getLHS()
          Returns the left-hand side of this rule.
 double getScore()
          Returns the score of this rule.
 void setScore(double score)
          Replaces the score of this rule with the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rule

public Rule()
Constructs a new rule.

Method Detail

getLHS

public abstract int getLHS()
Returns the left-hand side of this rule.

Returns:
the left-hand side of this rule

getScore

public double getScore()
Returns the score of this rule.

Returns:
the score of this rule

setScore

public void setScore(double score)
Replaces the score of this rule with the specified value.

Parameters:
score - the new score of this rule