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
SimpleGrammar
public SimpleGrammar()
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