|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.uzh.ifi.attempto.preditor.text.TextElement
public class TextElement
This class describes a text element (a word or phrase) that is used by the predictive editor. Every text element contains a text and one or more grammatical categories. If a text element contains more than one categories then this means that it can stand for any of these categories.
Constructor Summary | |
---|---|
TextElement()
Creates a text element with an empty string as its text and category of the same name. |
|
TextElement(int number)
Creates a new text element containing a number which is also the name of the category. |
|
TextElement(java.lang.String categoryName)
Creates a new text element where the text is the name of the category. |
|
TextElement(java.lang.String text,
java.util.List<Terminal> categories)
Creates a new text element with the given categories. |
|
TextElement(java.lang.String text,
java.lang.String categoryName)
Creates a new text element. |
|
TextElement(java.lang.String text,
Terminal category)
Creates a new text element with one category. |
|
TextElement(Terminal category)
Creates a new text element where the text is the name of the category. |
Method Summary | |
---|---|
boolean |
applyRestriction(Restriction restr)
Applies the given restriction by excluding all categories that are not fulfilled by the restriction. |
boolean |
equals(java.lang.Object obj)
Two text elements are equals if they share the same text. |
Terminal[] |
getCategories()
Returns the grammatical category of this text element. |
java.lang.String |
getOriginalText()
Returns the original text of this text element. |
java.lang.String |
getText()
Returns the text of this text element. |
void |
include(TextElement textElement)
Includes the categories of the given text element. |
void |
setID(int id)
Sets the feature "id" for all categories. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextElement(java.lang.String text, Terminal category)
text
- The text.category
- The category.public TextElement(java.lang.String text, java.util.List<Terminal> categories)
text
- The text.categories
- The categories.public TextElement(java.lang.String text, java.lang.String categoryName)
text
- The text.categoryName
- The name of the category.public TextElement(Terminal category)
category
- The category.public TextElement(java.lang.String categoryName)
categoryName
- The name of the category.public TextElement()
public TextElement(int number)
number
- The number.Method Detail |
---|
public java.lang.String getOriginalText()
public java.lang.String getText()
public Terminal[] getCategories()
public final boolean applyRestriction(Restriction restr)
restr
- The restriction to be applied.
public void setID(int id)
id
- The id value.public void include(TextElement textElement)
textElement
- The text element whose categories should be included.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
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 |