|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object standup.lexicon.WordSequence
public class WordSequence
Unsurprisingly, a sequence of words. More specifically, contains a
List
of WordString
s. A WordSequence
is used
to represent the orthographic spelling of a Lexeme
or a
WordForm
, or any other span of text.
Field Summary | |
---|---|
private List<WordString> |
seq
A List of WordString s. |
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
WordSequence()
Default class constructor creates an empty WordSequence . |
|
WordSequence(List<WordString> _seq)
Constructor which creates a WordSequence containing the given
WordString s. |
|
WordSequence(String ortho)
Constructs a WordSequence from the given String by
splitting it into separate WordString s using possible separator
characters ' ', '_', and '-'. |
Method Summary | |
---|---|
void |
add(String string)
Append a String to the end of this WordSequence . |
void |
add(WordSequence _w)
Append a WordSequence to the end of this WordSequence . |
void |
add(WordString _w)
Append a WordString to the end of this WordSequence . |
int |
compareTo(Object arg0)
|
boolean |
equals(Object obj)
|
List<WordString> |
getList()
Return the List of WordString s in this
WordSequence . |
int |
hashCode()
|
static WordSequence |
readXML(Element e)
Returns an instance of a WordSequence whose contents are
specified within the given XML Element . |
private List<WordString> |
splitString(String string)
Splites the given String into separate WordString s using
possible separator characters ' ', '_', and '-'. |
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 static final long serialVersionUID
private final List<WordString> seq
List
of WordString
s.
Constructor Detail |
---|
public WordSequence()
WordSequence
.
public WordSequence(List<WordString> _seq)
WordSequence
containing the given
WordString
s.
_seq
- public WordSequence(String ortho)
WordSequence
from the given String
by
splitting it into separate WordString
s using possible separator
characters ' ', '_', and '-'.
ortho
- Method Detail |
---|
private List<WordString> splitString(String string)
String
into separate WordString
s using
possible separator characters ' ', '_', and '-'.
string
- the String
to be split
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public int compareTo(Object arg0)
compareTo
in interface Comparable
public String toString()
toString
in class Object
public void add(String string)
String
to the end of this WordSequence
.
It may be split into separate WordString
s using possible
separator characters ' ', '_', and '-'.
string
- public void add(WordString _w)
WordString
to the end of this WordSequence
.
_w
- public void add(WordSequence _w)
WordSequence
to the end of this WordSequence
.
_w
- public List<WordString> getList()
List
of WordString
s in this
WordSequence
.
public void writeXML(Writer out, String indent) throws IOException, XMLException
XMLizable.writeXML(Writer, String)
. Writes out
this WordSequence
's contents in a wordseq
tag, e.g.
<wordseq> <string>what</string> <string>do</string> <string>you</string> <string>call</string> </wordseq>
writeXML
in interface XMLizable
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 WordSequence readXML(Element e)
WordSequence
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 |