|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hu.birot.OTKit.dataType.BasicSteps
public class BasicSteps
Static methods returning "basic steps", that is, simple instances of MapForms. It complements the class MapFormExamples.
Biro (2006) introduces the term basic step to denote a single
step in the structured candidate set. A basic step can be for instance
replacing (deleting, adding) a single substring in the surface form of the
candidate (see the changeSubstring (String, String)
method below).
Subsequently, the topology (neighborhood structure) of the candidate set is
defined as candidate C1 being neighbor of candidate C if and only f a single
basic step transforms C into C1.
In OTKit, basic steps are simple MapForms
, and so they can be
used not only for creating a topology, but also to create Gen, and so on.
For instance, in the Basic CV Theory of Prince and Smolensky, overparsing
and underparsing are two basic steps in defining their Gen. Both basic steps
can possibly be applied to several different loci in the underlying form.
From these simple instaces of MapForm
,
methods combining previously defined MapForms in class MapFormExamples
–
such as linearCombination()
– create more complex maps, to be used in
more complex Gen and Topology functions.
NB: The role of basic steps may be reconsidered in a latter version of OTKit.
MapForm
Constructor Summary | |
---|---|
BasicSteps()
|
Method Summary | |
---|---|
static MapForm |
changeSubstring(java.lang.String a,
java.lang.String b)
This static method returns a MapForm that maps a Form A to another form B if and only if field string of B can be obtained from field string of A by replacing one instance of the substring a with b. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicSteps()
Method Detail |
---|
public static MapForm changeSubstring(java.lang.String a, java.lang.String b)
This static method returns a MapForm that maps a Form A to another form B if and only if field string of B can be obtained from field string of A by replacing one instance of the substring a with b. (Both can be an empty string.) Otherwise, A and B must be the same (that is, their counters must be equal, if the they also include counters).
Method first returns the Form in which the leftmost occurrence of a has been rewritten as b. Method next returns the form in which the next occurrence of of a is rewritten as b. Method all returns all possible rewritings of a as b. Finally, method random rewrites the ith instance of a, where i is the least integer larger than rnd times the number of occurrences of the substring a.
There are a few problems you should be aware of. Occurrences of a in the input string can overlap. So, for instance if a is the string "aa", and b is "b", then Form("aaa") can be rewritten both as "ba" and as "ab". If b is the empty string, then the all-method will return a Vector of two string Forms, both being "a". If you would like to loop through the outputs using the next-method (starting with the first-method, and looping until MapForm.NoMoreForm has not been reached), then you will get in an infinite loop.
a
- Substring to be rewritten.b
- String replacing a.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |