java.lang.Objectucot.parser.Word
public class Word
"Word" of a sentence. It does not nessesary contain a single word but
can also contain for example an noun phrase (blak car). Word
can contain links to other Word
and they are used to model
depencies between different parts of sentence.
Sentence
Field Summary | |
---|---|
private java.lang.String |
basicForm
Basic form of the word this object is carrying. |
private java.util.List<Link> |
links
The links from this Word to other words. |
private java.lang.String |
original
Original form of the word this object is carrying. |
private java.lang.String |
wordClass
Class of the word. |
Constructor Summary | |
---|---|
Word(java.lang.String basicForm,
java.lang.String wordClass)
Constructs the word object. |
Method Summary | |
---|---|
void |
addLink(Link l)
Adds link.. |
java.lang.String |
getBasicForm()
Returns the basic form of the word. |
Link |
getLink(java.lang.String name)
Returns the first link called by spesific name- |
Word |
getLinked(java.lang.String name)
Returns the word that is refered by the first link called by the given name. |
java.util.List<Link> |
getLinks()
Returns all the links. |
java.util.List<Link> |
getLinks(java.lang.String name)
Returns links of spesific name. |
java.lang.String |
getOriginal()
Returns the original form of the word. |
java.lang.String |
getWordClass()
Returns the word's class (part of the speech: noun, verb and so on). |
boolean |
RemoveLink(Link l)
Removes link from this word. |
void |
setBasicForm(java.lang.String basicForm)
Sets the basic form of the word. |
void |
setOriginal(java.lang.String original)
Sets the original form of the word. |
void |
setWordClass(java.lang.String wordClass)
Sets the words class (part of the speech: noun, verb and so on). |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String original
private java.lang.String basicForm
private java.lang.String wordClass
ParserInterface.NOUN
,
ParserInterface.VERB
private java.util.List<Link> links
Word
to other words.
Constructor Detail |
---|
public Word(java.lang.String basicForm, java.lang.String wordClass)
Constructs the word object.
basicForm
- The basic form of the word.wordClass
- The class of the word.Method Detail |
---|
public void addLink(Link l)
Adds link..
l
- The link to be added.public java.util.List<Link> getLinks()
Returns all the links. Modifying the link list does not change the true linkages.
public java.util.List<Link> getLinks(java.lang.String name)
Returns links of spesific name. Modification of the returned list does not change the true linkages.
name
- The link name we are interested in.
public Link getLink(java.lang.String name)
Returns the first link called by spesific name-
name
- The name
public Word getLinked(java.lang.String name)
Returns the word that is refered by the first link called by the given name.
name
- The name.
public boolean RemoveLink(Link l)
Removes link from this word.
l
- The link to be removed.
public java.lang.String getBasicForm()
Returns the basic form of the word.
public void setBasicForm(java.lang.String basicForm)
Sets the basic form of the word.
basicForm
- The basic form.public java.lang.String getWordClass()
Returns the word's class (part of the speech: noun, verb and so on).
public void setWordClass(java.lang.String wordClass)
Sets the words class (part of the speech: noun, verb and so on).
wordClass
- The word's class.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getOriginal()
Returns the original form of the word.
public void setOriginal(java.lang.String original)
Sets the original form of the word.
*