ch.uzh.ifi.attempto.chartparser
Class LexicalRule

java.lang.Object
  extended by ch.uzh.ifi.attempto.chartparser.LexicalRule

public class LexicalRule
extends java.lang.Object

This class represents a lexical rule. Lexical rules can also be called "lexicon entries". A lexical rule consists of a word (in the form of a terminal category) and a pre-terminal category. In the pre-terminal category of a lexical rule is simply called its "category".

Author:
Tobias Kuhn

Constructor Summary
LexicalRule(Annotation annotation, java.util.List<Category> categories)
          Creates a new lexical rule.
LexicalRule(Annotation annotation, Preterminal category, Terminal word)
          Creates a new lexical rule.
LexicalRule(Preterminal category, java.lang.String word)
          Creates a new lexical rule.
LexicalRule(Preterminal category, Terminal word)
          Creates a new lexical rule.
LexicalRule(java.lang.String categoryName, java.lang.String word)
          Creates a new lexical rule.
 
Method Summary
 LexicalRule deepCopy()
          Creates a deep copy of this lexicon entry.
 Annotation getAnnotation()
          Returns the annotation object of this rule.
 Preterminal getCategory()
          Returns the category of the lexical rule.
 Terminal getWord()
          Returns the word of the lexical rule.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LexicalRule

public LexicalRule(Annotation annotation,
                   Preterminal category,
                   Terminal word)
Creates a new lexical rule.

Parameters:
annotation - The annotation object.
category - The category of the lexical rule.
word - The word of the lexical rule as a terminal category.

LexicalRule

public LexicalRule(Preterminal category,
                   Terminal word)
Creates a new lexical rule.

Parameters:
category - The category of the lexical rule.
word - The word of the lexical rule as a terminal category.

LexicalRule

public LexicalRule(Preterminal category,
                   java.lang.String word)
Creates a new lexical rule.

Parameters:
category - The category of the lexical rule.
word - The word of the lexical rule.

LexicalRule

public LexicalRule(java.lang.String categoryName,
                   java.lang.String word)
Creates a new lexical rule.

Parameters:
categoryName - The category name of the lexical rule.
word - The word of the lexical rule.

LexicalRule

public LexicalRule(Annotation annotation,
                   java.util.List<Category> categories)
Creates a new lexical rule.

Parameters:
annotation - The annotation object.
categories - This list must contain exactly two elements. The first one must be a pre-terminal category representing the category of the lexical rule. The second one must be a terminal category representing the word of the lexical rule.
Method Detail

getCategory

public Preterminal getCategory()
Returns the category of the lexical rule.

Returns:
The category of the lexical rule.

getWord

public Terminal getWord()
Returns the word of the lexical rule.

Returns:
The word as a terminal category.

getAnnotation

public Annotation getAnnotation()
Returns the annotation object of this rule.

Returns:
The annotation object.

deepCopy

public LexicalRule deepCopy()
Creates a deep copy of this lexicon entry.

Returns:
A deep copy.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 2008-2012, AceWiki developers