|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hu.birot.OTKit.otBuildingBlocks.Candidate
public class Candidate
Represents a candidate in the candidate set.
By default, a candidate is a pair of an underlying form and of a surface form. A (nick)name can also be associated with the candidate, but this name is optional. The name can, for instance, summarize the complex structure of the surface form.
In theory, the underlying form is necessary, but in practice you do not always want to bother about it. So the underlying form is made optional when constructing a Candidate: in such a case, an empty form will serve as the underlying form.
Additionally, the surface form can be replaced by a Vector of
Forms or by a HashMap mapping from Strings to Forms. The Vector of
Forms Candidate.chain
can be used for instance in OT-CC;
whereas the HashMap<String, Form> Candidate.multi
is
intended for use in multiple layered models. An example for such a multiple layered
model is Paul Boersma's approach, whose OTKit implementation
could use as many hash keys as "morpheme", "underlying form", "surface form",
"auditory form" and "articulatory form".
Field Summary | |
---|---|
static java.lang.String |
ArtF
String "articulatory form" used as the key of the articulatory form in the HashMap of a multilayered candidate. |
static java.lang.String |
AudF
String "auditory form" used as the key of the auditory form in the HashMap of a multilayered candidate. |
java.util.Vector<Form> |
chain
List of Forms, if optimization is performed on lists of forms, such as in OT-CC. |
static java.lang.String |
MorF
String "morphology" used as the key of the morphological form in the HashMap of a multilayered candidate. |
java.util.HashMap<java.lang.String,Form> |
multi
A map from the names of the levels of representation (such as the strings "underlying", "surface", "phonological", "phonetic" or "articulatory") to the corresponding forms. |
java.lang.String |
name
|
Form |
sf
|
static java.lang.String |
SF
String "surface form" used as the key of the surface form in the HashMap of a multilayered candidate. |
Form |
uf
|
static java.lang.String |
UF
String "underlying form" used as the key of the underlying form in the HashMap of a multilayered candidate. |
Constructor Summary | |
---|---|
Candidate(Form surfaceform)
This constructor defines a new candidate, with the surface surfaceform, and an empty underlying form. |
|
Candidate(Form underlyingform,
Form surfaceform)
This constructor defines a new candidate with explicitly giving it an underlying form and a surface form. |
|
Candidate(java.util.HashMap<java.lang.String,Form> form_per_level)
Construct a Candidate by specifying the HashMap describing the different levels of representations. |
|
Candidate(java.lang.String sform)
This constructor defines a new candidate, with a surface form containing the string sform, and an empty underlying form. |
|
Candidate(java.lang.String n,
Form underlyingform,
Form surfaceform)
This constructor defines a new candidate with explicitly giving it a name, an underlying form and a surface form. |
|
Candidate(java.lang.String name,
java.util.HashMap<java.lang.String,Form> form_per_level)
Construct a Candidate by specifying the HashMap describing the different levels of representations. |
|
Candidate(java.lang.String uform,
java.lang.String sform)
This constructor defines a new candidate. |
|
Candidate(java.lang.String n,
java.lang.String uform,
java.lang.String sform)
This constructor defines a new candidate. |
|
Candidate(java.lang.String name,
java.util.Vector<Form> chain_of_Forms)
Construct a Candidate by specifying a chain of forms. |
|
Candidate(java.util.Vector<Form> chain_of_Forms)
Construct a Candidate by specifying a chain of forms. |
Method Summary | |
---|---|
Candidate |
clone()
Creates a clone of the present candidate: the name, the underlying form, the surface form, the chain and the multi are all (shallowly) cloned separately. |
boolean |
equals(java.lang.Object o)
Two Candidates are equal if and only if their underlying forms are equal and their surface forms are equal (given the equal method for Forms). |
int |
hashCode()
|
java.lang.String |
toString()
This method turns the candidate into a String, which is convenient for printing out. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Form sf
public Form uf
public java.lang.String name
public java.util.Vector<Form> chain
Candidate
is not an OT candidate any more (an underlying
form–surface form pair) anymore, but a series of surface forms with the same
underlying form. Unless specified, it is an empty vector.
public java.util.HashMap<java.lang.String,Form> multi
public static final java.lang.String UF
public static final java.lang.String SF
public static final java.lang.String MorF
public static final java.lang.String AudF
public static final java.lang.String ArtF
Constructor Detail |
---|
public Candidate(java.lang.String n, java.lang.String uform, java.lang.String sform)
n
- A (nick)name of the candidate.uform
- String defining the underlying form.sform
- String defining the surface form.public Candidate(java.lang.String uform, java.lang.String sform)
uform
- String defining the underlying form.sform
- String defining the surface form.public Candidate(java.lang.String sform)
sform
- String defining the surface form.public Candidate(java.lang.String n, Form underlyingform, Form surfaceform)
n
- A (nick)name for the candidate.underlyingform
- The underlying form.surfaceform
- The surface form.public Candidate(Form underlyingform, Form surfaceform)
underlyingform
- The underlying form.surfaceform
- The surface form.public Candidate(Form surfaceform)
surfaceform
- The surface form.public Candidate(java.util.Vector<Form> chain_of_Forms)
Candidate.uf
is set as the 0th element of the parameter, and
Candidate.sf
will be the last element of the vector.
(Obviously, you may subsequently reset or ignore Candidate.uf
and
Candidate.sf
.)
chain_of_Forms
- Vector of Forms that should become Constraint.chain
.public Candidate(java.lang.String name, java.util.Vector<Form> chain_of_Forms)
Candidate.uf
is set as the 0th element of the parameter, and
Candidate.sf
will be the last element of the vector.
(Obviously, you may subsequently reset or ignore Candidate.uf
and
Candidate.sf
.)
name
- A (nick)name for the candidate.chain_of_Forms
- Vector of Forms that should become Constraint.chain
.public Candidate(java.lang.String name, java.util.HashMap<java.lang.String,Form> form_per_level)
Candidate.uf
is set as the Form mapped to by the key "underlying" in this hash, and
Candidate.sf
will be Form mapped to by the key "surface".
(Obviously, you may subsequently reset or ignore Candidate.uf
and
Candidate.sf
.)
name
- A (nick)name for the candidate.form_per_level
- HashMap that should become Constraint.multi
.public Candidate(java.util.HashMap<java.lang.String,Form> form_per_level)
Candidate.uf
is set as the Form mapped to by the key "underlying" in this hash, and
Candidate.sf
will be Form mapped to by the key "surface".
(Obviously, you may subsequently reset or ignore Candidate.uf
and
Candidate.sf
.)
form_per_level
- HashMap that should become Constraint.multi
.Method Detail |
---|
public Candidate clone()
Creates a clone of the present candidate: the name, the underlying form, the surface form, the chain and the multi are all (shallowly) cloned separately.
This method overrides the method java.lang.Object.clone
.
Note that the return type of the overridden method is
Candidate, and not Object.
clone
in class java.lang.Object
public java.lang.String toString()
This method turns the candidate into a String, which is convenient for printing out. It overrides java.lang.Object.toString.
If the name of the Candidate is not an empty string, then the output of the toString method starts with name + " : ". Then, if the uf is not an empty Form, then it contains uf.toString() + " | ". Finally, the String always contains sf.toString(). Note the importance of the Form.toString() method, which you may wish to override.
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |