|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.uzh.ifi.attempto.chartparser.Rule
public class Rule
This class represents a grammar rule. A rule consists of a nonterminal category as its head, a sequence of categories as its body, and a boolean value that describes whether it is accessible or not. If a rule is not accessible then this means that no category of the body and no subcategory of those categories is accessible by any category outside of the body. This can be used to define which parts of the sentence are accessible for anaphoric references from a given position.
Constructor Summary | |
---|---|
Rule(java.util.List<Category> categories)
Creates a new rule that is accessible. |
|
Rule(java.util.List<Category> categories,
boolean accessible)
Creates a new rule. |
|
Rule(Nonterminal head,
boolean accessible,
Category... body)
Creates a new rule. |
|
Rule(Nonterminal head,
Category... body)
Creates a new rule that is accessible. |
Method Summary | |
---|---|
Rule |
deepCopy()
Creates a deep copy of this rule. |
Rule |
deepCopy(java.util.HashMap<java.lang.Integer,ch.uzh.ifi.attempto.chartparser.StringEntity> entities)
Creates a deep copy of this rule using the given string entities. |
Category[] |
getBody()
Returns the body category sequence of this rule. |
Category |
getFirst()
Returns the first category of the body. |
Nonterminal |
getHead()
Returns the head category of this rule. |
boolean |
hasEmptyBody()
Returns true if the body is empty (i.e. |
boolean |
isAccessible()
Returns true if the rule is accessible. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Rule(Nonterminal head, boolean accessible, Category... body)
head
- The head category.accessible
- Defines whether the rule is accessible or not.body
- The body category sequence.public Rule(Nonterminal head, Category... body)
head
- The head category.body
- The body category sequence.public Rule(java.util.List<Category> categories, boolean accessible)
categories
- The first category of this list stands for the head category (it has to be
a Nonterminal object). The rest stands for the body categories.accessible
- Defines whether the rule is accessible or not.public Rule(java.util.List<Category> categories)
categories
- The first category of this list stands for the head category (it has to be
a Nonterminal object). The rest stands for the body categories.Method Detail |
---|
public Nonterminal getHead()
public Category[] getBody()
public boolean hasEmptyBody()
public Category getFirst()
public boolean isAccessible()
public Rule deepCopy()
public Rule deepCopy(java.util.HashMap<java.lang.Integer,ch.uzh.ifi.attempto.chartparser.StringEntity> entities)
entities
- The string entities to be used.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |