edu.stanford.nlp.lexgram
Class SimpleGrammar

java.lang.Object
  |
  +--edu.stanford.nlp.lexgram.SimpleGrammar
All Implemented Interfaces:
Grammar
Direct Known Subclasses:
DFSAGrammar

public class SimpleGrammar
extends Object
implements Grammar


Constructor Summary
SimpleGrammar()
           
 
Method Summary
 void addRule(Rule r)
           
protected  void addToMapValueSet(Map map, Object key, Object value)
           
 Set getLabels()
           
 Set getPatterns()
           
 Set getRules()
           
 Set getRulesByFirstItem(Object firstItem)
           
 Set getRulesByLabel(Label label)
           
 Set getRulesByPattern(Object pattern)
           
protected  void removeFromMapValueSet(Map map, Object key, Object value)
           
 void removeRule(Rule r)
           
 double scoreRule(Rule r)
           
 int size()
          Return the number of (simple linear) rules in the SimpleGrammar.
 String toString()
           
protected  void typeCheck(Rule r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleGrammar

public SimpleGrammar()
Method Detail

typeCheck

protected void typeCheck(Rule r)

addToMapValueSet

protected void addToMapValueSet(Map map,
                                Object key,
                                Object value)

removeFromMapValueSet

protected void removeFromMapValueSet(Map map,
                                     Object key,
                                     Object value)

addRule

public void addRule(Rule r)
Specified by:
addRule in interface Grammar

removeRule

public void removeRule(Rule r)
Specified by:
removeRule in interface Grammar

size

public int size()
Return the number of (simple linear) rules in the SimpleGrammar.

Returns:
the number of rules

getLabels

public Set getLabels()
Specified by:
getLabels in interface Grammar

getPatterns

public Set getPatterns()
Specified by:
getPatterns in interface Grammar

getRules

public Set getRules()
Specified by:
getRules in interface Grammar

getRulesByLabel

public Set getRulesByLabel(Label label)
Specified by:
getRulesByLabel in interface Grammar

getRulesByFirstItem

public Set getRulesByFirstItem(Object firstItem)
Specified by:
getRulesByFirstItem in interface Grammar

getRulesByPattern

public Set getRulesByPattern(Object pattern)
Specified by:
getRulesByPattern in interface Grammar

scoreRule

public double scoreRule(Rule r)
Specified by:
scoreRule in interface Grammar

toString

public String toString()
Overrides:
toString in class Object


Stanford NLP Group