|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object standup.lexicon.StructElement standup.lexicon.WordStruct
public class WordStruct
A structure that has a label and a sequence of StructElement
s, which
can be one of Lexeme
, WordForm
, WordString
or
WordStruct
. This enables the construction of hierarchical
structures, for example:
WordStruct s = <s, [np, vp, '.']>
WordStruct np = <np, ['the',lx026692]>
WordStruct vp = <vp, ['is',v]>
WordStruct v = <v, [lx182781]>
Lexeme lx026692 = "bank"
Lexeme lx182781 = "closed"
Field Summary | |
---|---|
private String |
label
|
private List<? extends StructElement> |
structElements
|
Constructor Summary | |
---|---|
WordStruct(String _l,
List<? extends StructElement> _se)
Constructor that provides the required label and list of StructElement s. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
WordSequence |
getSpelling()
Returns the linearized surface form of this WordStruct as a
WordSequence . |
List<? extends StructElement> |
getWordStructAsList()
Returns the List of StructElement s belonging to this
WordStruct . |
int |
hashCode()
|
static WordStruct |
readXML(Element e)
Returns an instance of a WordStruct whose contents are specified
within the given XML Element . |
String |
toString()
|
void |
writeXML(Writer out,
String indent)
Implementation of XMLizable.writeXML(Writer, String) . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final String label
private final List<? extends StructElement> structElements
Constructor Detail |
---|
public WordStruct(String _l, List<? extends StructElement> _se)
StructElement
s.
_l
- _se
- Method Detail |
---|
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public List<? extends StructElement> getWordStructAsList()
List
of StructElement
s belonging to this
WordStruct
.
public WordSequence getSpelling()
WordStruct
as a
WordSequence
.
getSpelling
in class StructElement
public String toString()
toString
in class Object
public void writeXML(Writer out, String indent) throws IOException, XMLException
XMLizable.writeXML(Writer, String)
. Writes out
this WordStruct
's contents in a struct
tag.
out
- The output stream for the XML file, which is assumed to be
already opened and writable.indent
- A string to be prepended before every line written by this
method. If passed appropriate white space, e.g.
XMLUtils.xmlIndent
, it can be used to control
indentation.
IOException
XMLException
public static WordStruct readXML(Element e)
WordStruct
whose contents are specified
within the given XML Element
.
e
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |