|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hu.birot.OTKit.otBuildingBlocks.Hierarchy
public class Hierarchy
Realizes a constraint hierarchy. A constraint hierarchy is a set of constraints with "ranking variables". OT literature employs several ranking variables, such as the unperturbed and the perturbed r in Paul Boersma's Stochastic OT or the K-value in Tamas Biro's SA-OT. This class is flexible, it allows employing more ranking variables at the same time, and one can add new ones in the future. Yet, an important feature of this class is the existence of methods sorting the constraint set for each of the "ranking variables".
At this moment, a constraint can be given the following
"ranking variables": kvalue, rank, rank1,
rank2, unperturbedRank (aka unperturbed_rank), perturbedRank
(aka perturbed_rank) and weight. Moreover, the hash rvariable
creates the opportunity to add further ones. All these ranking variables
have real values (of type Double).
Two further types have non-real values. Ranking variable "violrank" has
a value of type dataType.Violation
. The idea is that violations
realize a data type that is a generalization of real numbers: two violations
can be compared, and the difference of two violations can be defined. So the field
"violrank" allows you to create more general constraint rankings.
Ranking variable "setrank" allows creating a lattice of constraints with only a partial order. A "setrank" is a string seen as a set of characters. Constraint A is ranked higher than constraint B, if the setrank associated with A is a superset of the setrank of B.
Beside a Vector of ConstrValues (that is, tuples of constraint together with ranking variables), a Hierarchy also may have a name (see field Hierarchy.name) and a type (see field Hierarchy.type). The latter specifies which type of hierarchy we are speaking of: OT, HG, etc.
Important note: This class is planned to undergo a serious revision in the (near) future, especially regarding the "ranking variables".
Field Summary | |
---|---|
protected java.util.Vector<hu.birot.OTKit.otBuildingBlocks.Hierarchy.ConstrValue> |
cv
|
static java.lang.String |
HG
Constant String field used to represent type "hg". |
static java.lang.String |
KVALUE
Name of ranking variable 'kvalue'. |
java.lang.String |
name
The name of the hierarchy (optional). |
static java.lang.Object |
no_ranking_value
This object is returned whenever a constraint has no ranking value. |
static java.lang.String |
OT
Constant String field used to represent type "ot". |
static java.lang.String |
PERTURBED_RANK
Name of ranking variable 'perturbed_rank'. |
static java.lang.String |
RANK
Name of ranking variable 'rank'. |
static java.lang.String |
RANK1
Name of ranking variable 'rank1'. |
static java.lang.String |
RANK2
Name of ranking variable 'rank2'. |
static java.lang.String |
SETRANK
Name of ranking variable 'setrank'. |
java.lang.String |
type
The type of grammar the hierarchy is meant for. |
static java.lang.RuntimeException |
unknownCon
|
static java.lang.RuntimeException |
unknownConName
|
static java.lang.String |
UNPERTURBED_RANK
Name of ranking variable 'unperturbed_rank'. |
static java.lang.String |
VIOLRANK
Name of ranking variable 'violrank'. |
static java.lang.String |
WEIGHT
Name of ranking variable 'weight'. |
Constructor Summary | |
---|---|
Hierarchy()
Construct a hierarchy without any argument. |
|
Hierarchy(java.lang.String name_of_hierarchy)
Construct a hierarchy by specifying its name. |
Method Summary | |
---|---|
void |
addConstraint(Constraint cnstr)
Add a constraint to the hierarchy. |
void |
addConstraintWithKvalue(Constraint cnstr,
double k)
Add a constraint to the hierarchy with K-value r, unless the constraint (a constraint with the same name) is already contained by the hierarchy. |
void |
addConstraintWithPerturbedRank(Constraint cnstr,
double r)
Add a constraint to the hierarchy with perturbed rank r, unless the constraint (a constraint with the same name) is already contained by the hierarchy. |
void |
addConstraintWithRank(Constraint cnstr,
double r)
Add a constraint to the hierarchy with rank r, unless the constraint (a constraint with the same name) is already contained by the hierarchy. |
void |
addConstraintWithRank1(Constraint cnstr,
double r)
Add a constraint to the hierarchy with rank1 r, unless the constraint (a constraint with the same name) is already contained by the hierarchy. |
void |
addConstraintWithRank2(Constraint cnstr,
double r)
Add a constraint to the hierarchy with rank2 r, unless the constraint (a constraint with the same name) is already contained by the hierarchy. |
void |
addConstraintWithUnperturbedRank(Constraint cnstr,
double r)
Add a constraint to the hierarchy with unperturbed rank r, unless the constraint (a constraint with the same name) is already contained by the hierarchy. |
void |
addConstraintWithWeight(Constraint cnstr,
double w)
Add a constraint to the hierarchy with weight w, unless the constraint (a constraint with the same name) is already contained by the hierarchy. |
java.util.HashSet<java.lang.String> |
allRankingVariables()
Returns a set of all ranking variable names that are used by the hierarchy. |
Hierarchy |
clone()
Creates a clone of the hierarchy, with the same name, the same type and the same constraints. |
java.util.Vector<java.lang.String> |
constraintNames()
This method returns a Vector containing the names of all the constraints in the Hierarchy. |
java.util.Vector<Constraint> |
constraints()
This method returns a Vector containing all constraints in the Hierarchy. |
void |
copyRank(java.lang.String r1,
java.lang.String r2)
Copy values of ranking variable r1 to ranking variable r2 ,
for all constraints in the hierarchy. |
java.lang.Object |
get(java.lang.String cnstr_name,
java.lang.String rankname)
The value of ranking variable rankname for constraints |
void |
increaseRank(Constraint cnstr,
double delta)
Increase the value of rank variable "rank" by delta for constraint cnstr. |
void |
kvalue2rank()
This method copies the values in the ranking variable "K-values" to the ranking variable "rank", for each constraint. |
java.lang.Double |
kvalueOf(Constraint cnstr)
Returns the K-value of constraint cnstr in the hierarchy (that is, of the constr in the hierarchy whose name is the same as the name of cnstr). |
int |
numberOfConstraints()
This method returns the number of constraints in the hierarchy. |
void |
perturbed2rank()
This method copies the values in the ranking variable "perturbed rank" to the ranking variable "rank", for each constraint. |
java.lang.Double |
perturbedRankOf(Constraint cnstr)
Returns the perturbed rank of constraint cnstr in the hierarchy (that is, of the constr in the hierarchy whose name is the same as the name of cnstr). |
void |
perturbGaussian(double m,
double s)
The ranking variable "perturbed rank" of each constraint is set such that a random perturbation (noise) is added to the value of the ranking variable "unperturbed rank". |
void |
perturbUniform(double r)
The ranking variable "perturbed rank" of each constraint is set such that a random perturbation (noise) is added to the value of the ranking variable "unperturbed rank". |
void |
perturbUniform(double r,
double m)
The ranking variable "perturbed rank" of each constraint is set such that a random perturbation (noise) is added to the value of the ranking variable "unperturbed rank". |
java.lang.Double |
rank1Of(Constraint cnstr)
Returns the rank1 of constraint cnstr in the hierarchy (that is, of the constr in the hierarchy whose name is the same as the name of cnstr). |
java.lang.Double |
rank2Of(Constraint cnstr)
Returns the rank2 of constraint cnstr in the hierarchy (that is, of the constr in the hierarchy whose name is the same as the name of cnstr). |
void |
rank2weight(double q)
For each constraint in the hierarchy, this method sets the value of weight based on the values of rank. |
java.lang.Double |
rankOf(Constraint cnstr)
Returns the rank of constraint cnstr in the hierarchy (that is, of the constr in the hierarchy whose name is the same as the name of cnstr). |
void |
removeConstraint(Constraint cnstr)
Removes a constraint from the hierarchy. |
void |
removeConstraint(java.lang.String cnstr)
Removes a constraint from the hierarchy, whose name is cnstr. |
java.util.HashMap<java.lang.String,java.lang.Double> |
rvariableOf(Constraint cnstr)
|
void |
set(java.lang.String cnstr_name,
java.lang.String rankname,
java.lang.Object r)
Set the value of ranking variable rankname to r for
constraint with name cnstr_name . |
void |
setKvalue(Constraint cnstr,
double r)
Set the value of rank variable "kvalue" to r for constraint cnstr. |
void |
setKvalue(java.lang.String cnstr_name,
double r)
Set the value of rank variable "kvalue" to r for the constraint whose name is cnstr_name. |
void |
setPerturbedRank(Constraint cnstr,
double r)
Set the value of rank variable "perturbed rank" to r for constraint cnstr. |
void |
setPerturbedRank(java.lang.String cnstr_name,
double r)
Set the value of rank variable "perturbed rank" to r for the constraint whose name is cnstr_name. |
void |
setRank(Constraint cnstr,
double r)
Set the value of rank variable "rank" to r for constraint cnstr. |
void |
setRank(java.lang.String string_describing_hierarchy)
Set the values of the ranking parameter "rank" according to the hierarchy described in the parameter of this method. |
void |
setRank(java.lang.String cnstr_name,
double r)
Set the value of rank variable "rank" to r for the constraint whose name is cnstr_name. |
void |
setRank1(Constraint cnstr,
double r)
Set the value of rank variable "rank1" to r for constraint cnstr. |
void |
setRank1(java.lang.String cnstr_name,
double r)
Set the value of rank variable "rank1" to r for the constraint whose name is cnstr_name. |
void |
setRank2(Constraint cnstr,
double r)
Set the value of rank variable "rank2" to r for constraint cnstr. |
void |
setRank2(java.lang.String cnstr_name,
double r)
Set the value of rank variable "rank2" to r for the constraint whose name is cnstr_name. |
void |
setUnperturbedRank(Constraint cnstr,
double r)
Set the value of rank variable "unperturbed rank" to r for constraint cnstr. |
void |
setUnperturbedRank(java.lang.String cnstr_name,
double r)
Set the value of rank variable "unperturbed rank" to r for the constraint whose name is cnstr_name. |
void |
setWeight(Constraint cnstr,
double w)
Set the value of rank variable "weight" to w for constraint cnstr. |
void |
setWeight(java.lang.String cnstr_name,
double w)
Set the value of rank variable "weight" to w for the constraint whose name is cnstr_name. |
Constraint[] |
sortBy(java.lang.String rank)
Returns an array of the constraints in the hierarchy, sorted from "least influential" to "most influential", with respect to the ranking variable rank . |
Constraint[] |
sortByKvalue()
Returns an array of constraints sorted by increasing K-values. |
Constraint[] |
sortByPerturbedRank()
Returns an array of constraints sorted by increasing perturbed rank. |
Constraint[] |
sortByRank()
Returns an array of constraints sorted by rank in an increasing order. |
Constraint[] |
sortByRank1()
Returns an array of constraints sorted by increasing rank1. |
Constraint[] |
sortByRank2()
Returns an array of constraints sorted by increasing rank2. |
void |
sortByRank2hierarchyKvalue()
This method sorts the constraints in the hierarchy by ranking variable "rank", and encodes it in the ranking variable "K-value". |
void |
sortByRank2hierarchyKvalueAndWeight(double q)
This method combines the methods sortByRank(), sortByRank2hierarchyKvalue() and sortByRank2hierarchyWeight(double q). |
void |
sortByRank2hierarchyWeight(double q)
This method sorts the constraints in the hierarchy by ranking variable "rank", and encodes it in the ranking variable "weight". |
Constraint[] |
sortByUnperturbedRank()
Returns an array of constraints sorted by increasing unperturbed rank. |
Constraint[] |
sortByWeight()
Returns an array of constraints sorted by decreasing weight. |
Constraint[] |
sortedByRank()
This method returns the constraints in the hierarchy sorted by ranking variable "rank", provided that method sortByRank has been applied previously. |
java.lang.String |
sortedByRankHierarchy()
This method returns a string describing the hierarchy as sorted by rank, supposing that method sortByRank has been applied previously. |
void |
unperturbed2rank()
This method copies the values in the ranking variable "unperturbed rank" to the ranking variable "rank", for each constraint. |
java.lang.Double |
unperturbedRankOf(Constraint cnstr)
Returns the unperturbed rank of constraint cnstr in the hierarchy (that is, of the constr in the hierarchy whose name is the same as the name of cnstr). |
java.util.HashMap<Constraint,Violation> |
value(Candidate can)
Returns the evaluation of a candidate by each constraint in this hierarchy in the form of a hash table. |
void |
weight2rank(double q)
For each constraint in the hierarchy, this method sets the value of rank based on the values of weight. |
java.lang.Double |
weightOf(Constraint cnstr)
Returns the weight of constraint cnstr in the hierarchy (that is, of the constr in the hierarchy whose name is the same as the name of cnstr). |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Object no_ranking_value
toString()
method returns an empty string. Note that
standard ranking variables with a double
value return
Double.NaN
in similar cases.
protected java.util.Vector<hu.birot.OTKit.otBuildingBlocks.Hierarchy.ConstrValue> cv
public java.lang.String name
public java.lang.String type
Hierarchy.OT
and Hierarchy.HG
.
Default value: an empty string.
public static final java.lang.String OT
public static final java.lang.String HG
public static final java.lang.RuntimeException unknownCon
public static final java.lang.RuntimeException unknownConName
public static final java.lang.String RANK
public static final java.lang.String RANK1
public static final java.lang.String RANK2
public static final java.lang.String PERTURBED_RANK
public static final java.lang.String UNPERTURBED_RANK
public static final java.lang.String KVALUE
public static final java.lang.String WEIGHT
public static final java.lang.String SETRANK
public static final java.lang.String VIOLRANK
Constructor Detail |
---|
public Hierarchy()
public Hierarchy(java.lang.String name_of_hierarchy)
name_of_hierarchy
- : The name of the hierarchy to be constructed.Method Detail |
---|
public void addConstraint(Constraint cnstr)
Add a constraint to the hierarchy. If the constraint (a constraint with the same name) is already contained by the hierarchy, then the new constraint takes the place of the old one (keeping the ranking variables of the old one).
cnstr
- : The constraint to be added to the hierarchy.public void addConstraintWithRank(Constraint cnstr, double r)
cnstr
- : The constraint to be added to the hierarchy.r
- : the value of rank.public void addConstraintWithKvalue(Constraint cnstr, double k)
cnstr
- : The constraint to be added to the hierarchy.k
- : the value of K-value.public void addConstraintWithRank1(Constraint cnstr, double r)
cnstr
- : The constraint to be added to the hierarchy.r
- : the value of rank1.public void addConstraintWithRank2(Constraint cnstr, double r)
cnstr
- : The constraint to be added to the hierarchy.r
- : the value of rank2.public void addConstraintWithUnperturbedRank(Constraint cnstr, double r)
cnstr
- : The constraint to be added to the hierarchy.r
- : the value of unperturbed rank.public void addConstraintWithPerturbedRank(Constraint cnstr, double r)
cnstr
- : The constraint to be added to the hierarchy.r
- : the value of perturbed rank.public void addConstraintWithWeight(Constraint cnstr, double w)
cnstr
- : The constraint to be added to the hierarchy.w
- : the value of the weight.public java.util.Vector<Constraint> constraints()
This method returns a Vector containing all constraints in the Hierarchy.
public java.util.Vector<java.lang.String> constraintNames()
This method returns a Vector containing the names of all the constraints in the Hierarchy.
public java.lang.Double rankOf(Constraint cnstr)
public java.lang.Double kvalueOf(Constraint cnstr)
public java.lang.Double rank1Of(Constraint cnstr)
public java.lang.Double rank2Of(Constraint cnstr)
public java.lang.Double unperturbedRankOf(Constraint cnstr)
public java.lang.Double perturbedRankOf(Constraint cnstr)
public java.lang.Double weightOf(Constraint cnstr)
public java.util.HashMap<java.lang.String,java.lang.Double> rvariableOf(Constraint cnstr)
public java.lang.Object get(java.lang.String cnstr_name, java.lang.String rankname)
The value of ranking variable rankname
for constraints
If rankname
is one of the following:
"rank", "rank1", "rank2", "perturbed_rank" (sic!), "unperturbed_rank" (sic!), "kvalue" and "weight" (all case sensitive)then one of the standard ranking variable are returned (see the other methods). Otherwise, the value mapped to by the hash
rvariable
is returned.
Exception is thrown, if cnstr_name
does not correspond to any
constraint with that name.
cnstr_name
- Name of the constraint.rankname
- Name of the ranking variable.
Hierarchy.no_ranking_value
object if no value is specified for the given constraint.public void setRank(Constraint cnstr, double r)
public void setRank(java.lang.String cnstr_name, double r)
public void setKvalue(Constraint cnstr, double r)
public void setKvalue(java.lang.String cnstr_name, double r)
public void setRank1(Constraint cnstr, double r)
public void setRank1(java.lang.String cnstr_name, double r)
public void setRank2(Constraint cnstr, double r)
public void setRank2(java.lang.String cnstr_name, double r)
public void setUnperturbedRank(Constraint cnstr, double r)
public void setUnperturbedRank(java.lang.String cnstr_name, double r)
public void setPerturbedRank(Constraint cnstr, double r)
public void setPerturbedRank(java.lang.String cnstr_name, double r)
public void setWeight(Constraint cnstr, double w)
public void setWeight(java.lang.String cnstr_name, double w)
public void setRank(java.lang.String string_describing_hierarchy)
Set the values of the ranking parameter "rank" according to the hierarchy described in the parameter of this method.
The parameter string_describing_hierarchy is a string in the form "C1 >> C2 >> C3 etc.", with C1, C2, C3 etc. being the constraints' name in this hierarchy. The names of the constraints are separated by the character pair ">>", while white spaces (including tabs, etc.) are ignored (trimmed). The format corresponds to the one produced by the method sortedByRankHierarchy().
The constraint whose name appears rightmost in this string is assigned a ranking parameter "rank" of value 1; this is the constraint that is intended to be ranked to the lowest position in the hierarchy. The second constraint from the right gets a rank of 2, and so forth. The leftmost constraint (to be ranked the highest) is assigned a rank equal to the number of constraints mentioned in the string.
The rank of any constraint in the hierarchy whose name is not mentioned in the string will not have its rank changed. A constraint name in the string that does not correspond to the name of any constraint in the hierarchy will result in a Runtime Exception "Unknown constraint name".
string_describing_hierarchy
- A string describing the intended hierarchy.public void set(java.lang.String cnstr_name, java.lang.String rankname, java.lang.Object r)
Set the value of ranking variable rankname
to r
for
constraint with name cnstr_name
.
If rankname
is one of the following:
"rank", "rank1", "rank2", "perturbed_rank" (sic!), "unperturbed_rank" (sic!), "kvalue" and "weight" (all case sensitive)then one of the standard ranking variable are affected (see the other methods). Otherwise, the information goes to the hash
rvariable
.
If r
is Hierarchy.no_ranking_value
, then the
above ranking variables are set to Double.NaN
, and all other ranking
names are removed from the hash rvariable
.
Exception is thrown, if cnstr_name
does not correspond to any
constraint with that name.
cnstr_name
- Name of the constraint whose ranking variable has to be set.rankname
- Name of the ranking variable to be set.r
- Value to which the ranking variable has to be set.public Constraint[] sortByRank()
Returns an array of constraints sorted by rank in an increasing order. Element 0 is the lowest ranked one (it has the lowest ranking variable "rank"), whereas the last element in the array (nr. length()-1) is ranked the highest (it has the highest value for "rank").
If this array is required several times, you can employ this method only once, and then employ method sortedByRank(), which does not employ the sorting algorithm (provided that the rank values do not change).
public Constraint[] sortedByRank()
public java.lang.String sortedByRankHierarchy()
This method returns a string describing the hierarchy as sorted by rank, supposing that method sortByRank has been applied previously.
public Constraint[] sortByKvalue()
public Constraint[] sortByRank1()
public Constraint[] sortByRank2()
public Constraint[] sortByUnperturbedRank()
public Constraint[] sortByPerturbedRank()
public Constraint[] sortByWeight()
public Constraint[] sortBy(java.lang.String rank)
Returns an array of the constraints in the hierarchy, sorted from
"least influential" to "most influential", with respect to the ranking
variable rank
. For most ranking variable, the constraints
are ranked for increasing rank. But for weight, they are ranked for decreasing
rank.
rank
- Ranking variable according to which constraints are ranked.
rank
.public void copyRank(java.lang.String r1, java.lang.String r2)
r1
to ranking variable r2
,
for all constraints in the hierarchy. Regarding the values of r1
and r2
,
see methods get
and set
.
r1
- Name of the original ranking variable.r2
- Name of the target ranking variable.public void increaseRank(Constraint cnstr, double delta)
public void rank2weight(double q)
q
- : The base defining the transformation (q>0).public void weight2rank(double q)
q
- : The base defining the transformation (q>0).public void perturbUniform(double r)
r
- : The width (range) of the uniform distribution
that determines the noise to be added to the unperturbed
rank values.public void perturbUniform(double r, double m)
r
- : The width (or range) of the uniform distribution that
determines the noise to be added to the unperturbed
rank values.m
- : The mean of the random distribution.public void perturbGaussian(double m, double s)
m
- : The mean of the Normal distribution which
is followed by the Gauusian noise.s
- : The standard deviation of the Normal distribution
which is followed by the Gauusian noise.public void perturbed2rank()
This method can be useful when employing methods Eval.Compare and Eval.CompareOT, which use the ranking variable "rank". In this case, do not forget running the method Hierarchy.sortByRank(), after running method perturbed2rank() and before running Eval.Compare.
public void unperturbed2rank()
This method can be useful when employing methods Eval.Compare and Eval.CompareOT, which use the ranking variable "rank". In this case, do not forget running the method Hierarchy.sortByRank(), after running method unperturbed2rank() and before running Eval.Compare.
public void kvalue2rank()
This method can be useful when employing methods Eval.Compare and Eval.CompareOT, which use the ranking variable "rank". In this case, do not forget running the method Hierarchy.sortByRank(), after running method unperturbed2rank() and before running Eval.Compare.
public void sortByRank2hierarchyKvalue()
This method sorts the constraints in the hierarchy by ranking variable "rank", and encodes it in the ranking variable "K-value". The lowest ranked constraint (the one with the lowest value for "rank") is assigned a K-value of 0, the second lowest ranked constraint (with respect to "rank") is assigned a K-value of 1, etc. The highest ranked constraint (the one with the highest value for "rank") is assigned a K-value equal to the number of constraints in the hierarchy minus one.
public void sortByRank2hierarchyWeight(double q)
This method sorts the constraints in the hierarchy by ranking variable "rank", and encodes it in the ranking variable "weight". The lowest ranked constraint (the one with the lowest value for "rank") is assigned a weight of -1, the second lowest ranked constraint (with respect to "rank") is assigned a weight of -q, etc. The highest ranked constraint (the one with the highest value for "rank") is assigned a weight equal to -q^L, where L is the number of constraints in the hierarchy minus one.
q
- The base used to calculate the weights.public void sortByRank2hierarchyKvalueAndWeight(double q)
q
- The base used to calculate the weights.public java.util.HashSet<java.lang.String> allRankingVariables()
public void removeConstraint(Constraint cnstr)
Removes a constraint from the hierarchy. If the specified constraint is not contained in the hierarchy, then runtime error "Unknown constraint" is thrown.
cnstr
- Constraint to be removed from the hierarchy.public void removeConstraint(java.lang.String cnstr)
Removes a constraint from the hierarchy, whose name is cnstr. If no constraint with such a name is contained in the hierarchy, then runtime error "Unknown constraint name" is thrown.
cnstr
- Name of the Constraint to be removed from the hierarchy.public java.util.HashMap<Constraint,Violation> value(Candidate can)
Returns the evaluation of a candidate by each constraint in this hierarchy in the form of a hash table. The return value of this method is a hash that maps a constraint c (from this hierarchy) onto c.value(can), that is, the violation level assigned by constraint c to candidate can.
can
- The candidate to be evaluated by all constraints in the hierarchy.
public int numberOfConstraints()
public Hierarchy clone()
Creates a clone of the hierarchy, with the same name, the same type and the same constraints. For each constraint the values of the ranking variables (rank, rank 1, rank 2, K-value, perturbed rank, perturbed rank, weight) are also copied.
Overrides java.lang.Object.clone. Note that the return type of this method is Hierarchy, and not Object, as the return type of the original method.
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |