up
Class UnaryRule

java.lang.Object
  extended by up.Rule
      extended by up.UnaryRule

public class UnaryRule
extends Rule

A unary rule of a PCFG. This is a rule of the form A → B.


Constructor Summary
UnaryRule(int lhs, int rhs)
          Constructs a new unary rule.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Tests whether this rule is equal to the specified object.
 int getLHS()
          Returns the left-hand side of this rule.
 int getRHS()
          Returns the right-hand side of this rule.
 int hashCode()
          Returns the hash code of this rule.
 
Methods inherited from class up.Rule
getScore, setScore
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnaryRule

public UnaryRule(int lhs,
                 int rhs)
Constructs a new unary rule.

Parameters:
lhs - the left-hand side of the new rule
rhs - the right-hand side of the new rule
Method Detail

getLHS

public int getLHS()
Description copied from class: Rule
Returns the left-hand side of this rule.

Specified by:
getLHS in class Rule
Returns:
the left-hand side of this rule

getRHS

public int getRHS()
Returns the right-hand side of this rule.

Returns:
the right-hand side of this rule

equals

public boolean equals(java.lang.Object obj)
Tests whether this rule is equal to the specified object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare with
Returns:
true iff this rule is equal to the specified object

hashCode

public int hashCode()
Returns the hash code of this rule.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code of this rule