hu.birot.OTKit.grammarExamples
Class MetricalStress

java.lang.Object
  extended by hu.birot.OTKit.otBuildingBlocks.Grammar
      extended by hu.birot.OTKit.grammarExamples.MetricalStress

public class MetricalStress
extends Grammar

Implementation of the nowadays standard model of metrical phonology. As papers on metrical phonology keep introducing new variants, this class is probably going to be increased in the future with new constraints.

Underlying forms are strings of phonemes, parsed into syllables. In the middle of the word, syllables are delineated by the end-of-syllable character EOS (by default the full stop .). Phonemes can be listed in the arrays vowels and consonants respectively. By default, these arrays contain the lower case alphabetical characters (5 vowels and 21 consonants). The EOS character, the stress symbols and the foot delimiters must not be listed in either of these arrays.

A surface form is the underlying form string interspersed with foot delimiters and stress symbols. Feet are delimited with the BOF and EOF symbols (opening and closing brackets by default), whereas the primary stress symbol PRS and the secondary stress symbols SCS (by default, 1 and 2 respectively) precede the phonemes of the corresponding string. For instance: ab.[1ra.ca].dab.[2ra].

The base generates underlying forms using the lists (arrays) of vowels and consonants. Longer forms have less chance to be generated.

The gen adds feet and stress to the underlying form. Every valid candidate is generated with equal probability. A candidate is valid if and only if it satisfies the following criteria:

  1. The underlying form is equal to the surface form after having removed all foot delimiters and stress symbols.
  2. Feet do not overlap in a surface form. Every opening bracket is followed by a closing bracket, and every closing bracket is preceded by an opening bracket.
  3. Every foot has exactly one stressed syllable, with either primary or secondary stress.
  4. A foot contains one or two syllables, not less and not more.
  5. A surface form contains exactly one foot with primary stress.

Two candidates are neighbors if and only if they share their uf, and exactly one of the following operations (basic steps) transform the sf of the first candidate into the sf of the second candidate (cf. Biro, Finding the Right Words, 2006:130):

  1. An unparsed syllable is parsed into a monosyllabic foot with secondary stress.
  2. A monosyllabic foot with secondary stress is deparsed into an unparsed syllable.
  3. A monosyllabic foot is enlarged to include the adjacent unparsed syllable.
  4. A bisyllabic foot is narrowed down to a monosyllabic foot by deparsing its unstressed syllable.
  5. The stress moves from one syllable to the other syllable in a bisyllabic foot.
  6. The syllable with the primary stress is reduced to having secondary stress, while the stressed syllable in another foot receives primary stress.

A number of methods return constraints. Some of these methods correspond to constraint families, and so they also require an argument to instantiate an actual constraint. All constraint suppose that they will be applied to valid candidates.

The MapForm utter removes the brackets from the surface forms. What remains is an overt form: a string with syllable borders and stress symbols.

The Gen rip (Robust Interpretive Parsing, cf. Tesar and Smolensky) does the opposite: for any overt form, it returns the set of candidates (underlying form-surface form pairs) that are uttered as that overt form. Stress information makes the overt form richer than the underlying form, and foot brackets make the surface form even richer.


Field Summary
static java.lang.String ALIGN_CONTAINER_PRWORD
          Alignment constraint aligns objects to the left/right edge of the prosodic word.
static java.lang.String ALIGN_DIRECTION_LEFT
          Alignment constraint aligns left edge of object to left edge of container.
static java.lang.String ALIGN_DIRECTION_RIGHT
          Alignment constraint aligns right edge of object to right edge of container.
static java.lang.String ALIGN_OBJECT_ALLFEET
          Align all feet to the edge of the container.
static java.lang.String ALIGN_OBJECT_MAINFOOT
          Align the main foot to the edge of the container.
static java.lang.String ALIGN_UNIT_MORA
          Alignment constraint measures distances in terms of moras (morae).
static java.lang.String ALIGN_UNIT_SYLLABLE
          Alignment constraint measures distances in terms of syllables.
static java.lang.String ALIGNMENT
          Name of constraint family 'Alignment'.
 MapForm base
           
static java.lang.String BINARY
          Name of the constraint 'Binary', 'Foot Binarity'.
 char BOF
          Beginning of foot symbol.
static int CODA
          Feature 'syllable has a coda'.
static int COMPLEXCODA
          Feature 'syllable has a complex coda'.
 char EOF
          End of foot symbol.
 char EOS
          End-of-syllable character.
 Gen gen
           
 char LONG
          Symbol that lengthens the previous segment.
static int LONGNUCLEUS
          Feature 'syllable has a long nucleus'.
static int LONGNUCLEUS_AND_CODA
          Feature 'syllable has a long nucleus, as well as a coda'.
static int LONGNUCLEUS_AND_COMPLEXCODA
          Feature 'syllable has a long nucleus, as well as a complex coda'.
 char MORA
          Symbol that denotes a mora in the string.
static java.lang.String NOCLASH
          Name of constraint '*Clash'.
static java.lang.String NOLAPSE
          Name of constraint '*Lapse'.
static java.lang.String NONFINAL
          Name of constraint 'NonFinality'.
static java.lang.String NONFINALSTRESS
          Name of constraint 'NonFinalStress'.
static java.lang.String PARSE
          Name of the constraint 'Parse syllable'.
 char PRS
          Primary stress symbol.
static java.lang.String QALIGNMENT
          Name of John J.
static java.lang.String RHTYPE
          Name of constraint family 'RhythmType'.
static int RHTYPE_LEFT
          Rhythm type (foot type) 'left'.
static int RHTYPE_NONLEFT
          Rhythm type (foot type) 'non-left'.
static int RHTYPE_NONRIGHT
          Rhythm type (foot type) 'non-right'.
static int RHTYPE_RIGHT
          Rhythm type (foot type) 'right'.
 Gen rip
          Robust Interpretive Parsing: maps an overt form to a set of candidates.
 char SCS
          Secondary stress symbol.
static java.lang.String STRESS_TO_WEIGHT
          Name of constraint 'Stress-to-weight'.
 char SYLL
          Symbol that denotes a syllable.
 Topology topology
           
static java.lang.String UNIT_MORA
          Constant denoting one mora unit.
static java.lang.String UNIT_SYLL
          Constant denoting one syllable unit.
 MapForm utter
          Map surface form to overt form: remove foot brackets, keep stress information.
static java.lang.String WSP
          Name of constraint 'Weight-to-Stress Principle', or WSP.
 
Fields inherited from class hu.birot.OTKit.otBuildingBlocks.Grammar
hierarchy, type
 
Constructor Summary
MetricalStress()
          Metrical stress phonology is created with the default lists of vowels ('a', 'e', 'i', 'o' and 'u') and consonants (all other 21 lower case characters, from 'b' to 'z').
MetricalStress(char[] vowellist, char[] consonantlist)
          Metrical stress phonology is created with the specified lists of vowels and consonants.
 
Method Summary
 Form addMora(Form f, int heavy)
          Add MORA symbols to the string in form f, depending on the heaviness of the syllables.
 Form addMora(Form f, int heavy, int superheavy)
          Add MORA symbols to the string in form f, depending on the heaviness of the syllables.
 Constraint Alignment(java.lang.String object, java.lang.String container, java.lang.String direction, java.lang.String unit)
          Alignment constraints.
 Constraint Binary()
          Return the constraint 'Foot Binarity'.
 Constraint Binary(java.lang.String unit)
          Return the constraint 'Foot Binarity'.
 Constraint BinaryMoraic(int heavy)
          Return the constraint 'Foot Binarity (moraic)'.
 Constraint NoClash()
          Return the constraint '*Clash'.
 Constraint NoLapse()
          Return the constraint '*Lapse'.
 Constraint NonFinal()
          Return the constraint 'NonFinal'.
 Constraint NonFinalStress()
          Return the constraint 'NonFinalStress'.
 Constraint Parse()
          Return the constraint 'Parse'.
 Constraint QAlignment(java.lang.String object, java.lang.String container, java.lang.String direction, java.lang.String unit)
          Quantized alignment constraints.
 Constraint RhType(int type)
          Return a constraint in the class 'RhythmType()'.
 Constraint Stress_to_weight(int heavy)
          Return the constraint 'Stress-to-weight'.
 Constraint WSP(int heavy)
          Return the constraint 'Weight to Stress' (WSP).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOS

public char EOS
End-of-syllable character. By default, the full stop ., but can be changed if needed.

The EOS character is used only within the string, neither at its beginning, nor at its end. The beginning of the string and its end are also seen as delineating syllables. So, if for example the string begins with an EOS character, it will be understood as if the form contained an empty syllable (with no phoneme).


BOF

public char BOF
Beginning of foot symbol. By default, an opening bracket.


EOF

public char EOF
End of foot symbol. By default, a closing bracket.


PRS

public char PRS
Primary stress symbol. By default, '1'.


SCS

public char SCS
Secondary stress symbol. By default, '2'.


LONG

public char LONG
Symbol that lengthens the previous segment. By default, ':'.


MORA

public char MORA
Symbol that denotes a mora in the string. By default, the Greek letter mu ('µ').


SYLL

public char SYLL
Symbol that denotes a syllable. By default, the Greek letter sigma ('σ').


base

public MapForm base

gen

public Gen gen

topology

public Topology topology

utter

public MapForm utter
Map surface form to overt form: remove foot brackets, keep stress information.


rip

public Gen rip

Robust Interpretive Parsing: maps an overt form to a set of candidates. In practice, it behaves as a Gen function, but it gets an overt form instead of an underlying form.

Underlying forms consist of segments (consonants and vowels) and of EOS symbols only, whereas overt forms also contain stress symbols (PRS and SCS). (Surface forms additionally contain foot brackets: BOF and EOF symbols.)

Method allCandidates(Form overtform) receives an overt form and returns a vector of all candidates (underlying form-surface form pairs) such that the segments and syllable borders are unchanged, and the surface form contains the same stress pattern as the overt form.

Method firstCandidates(Form overtform) returns the first of the previously mentioned candidates.

Method randomCandidates(Form overtform) returns a random element of the previously mentioned candidates. Candidates have equal probability.

Finally, method nextCandidates(Candidate c) returns the next one of the above mentioned candidates. In this case, the overt form needs not be mentioned, because it is implicit in the surface form of c.


PARSE

public static final java.lang.String PARSE
Name of the constraint 'Parse syllable'.

See Also:
Constant Field Values

BINARY

public static final java.lang.String BINARY
Name of the constraint 'Binary', 'Foot Binarity'.

See Also:
Constant Field Values

UNIT_SYLL

public static final java.lang.String UNIT_SYLL
Constant denoting one syllable unit. Used for instance in method Binary(char).

See Also:
Constant Field Values

UNIT_MORA

public static final java.lang.String UNIT_MORA
Constant denoting one mora unit. Used for instance in method Binary(char).

See Also:
Constant Field Values

NONFINAL

public static final java.lang.String NONFINAL
Name of constraint 'NonFinality'.

See Also:
NONFINALSTRESS, NonFinal(), Constant Field Values

NONFINALSTRESS

public static final java.lang.String NONFINALSTRESS
Name of constraint 'NonFinalStress'.

See Also:
NONFINAL, NonFinalStress(), Constant Field Values

NOCLASH

public static final java.lang.String NOCLASH
Name of constraint '*Clash'.

See Also:
NoClash(), Constant Field Values

NOLAPSE

public static final java.lang.String NOLAPSE
Name of constraint '*Lapse'.

See Also:
NoLapse(), Constant Field Values

STRESS_TO_WEIGHT

public static final java.lang.String STRESS_TO_WEIGHT
Name of constraint 'Stress-to-weight'.

See Also:
Stress_to_weight(int), Constant Field Values

WSP

public static final java.lang.String WSP
Name of constraint 'Weight-to-Stress Principle', or WSP.

See Also:
WSP(int), Constant Field Values

RHTYPE_LEFT

public static final int RHTYPE_LEFT
Rhythm type (foot type) 'left'. The first syllable in the foot must be stressed, such as monosyllabic feet and trochees, but not binary iambs.

See Also:
Constant Field Values

RHTYPE_RIGHT

public static final int RHTYPE_RIGHT
Rhythm type (foot type) 'right'. The last syllable in the foot must be stressed, such as monosyllabic feet and iambs, but not binary trochees.

See Also:
Constant Field Values

RHTYPE_NONLEFT

public static final int RHTYPE_NONLEFT
Rhythm type (foot type) 'non-left'. The first syllable in the foot must be unstressed, such as binary iambs, but not monosyllabic feet and trochees.

See Also:
Constant Field Values

RHTYPE_NONRIGHT

public static final int RHTYPE_NONRIGHT
Rhythm type (foot type) 'non-right'. The last syllable in the foot must be unstressed, such as binary trochees, but not monosyllabic feet and iambs.

See Also:
Constant Field Values

RHTYPE

public static final java.lang.String RHTYPE
Name of constraint family 'RhythmType'.

See Also:
RhType(int), Constant Field Values

ALIGNMENT

public static final java.lang.String ALIGNMENT
Name of constraint family 'Alignment'.

See Also:
Constant Field Values

ALIGN_OBJECT_MAINFOOT

public static final java.lang.String ALIGN_OBJECT_MAINFOOT
Align the main foot to the edge of the container. The main foot is the foot containing the primary stress of the word. The distance (number of units intervening) is measured between the edge of the container and the edge of the main foot only.

See Also:
Alignment(String, String, String, String), ALIGN_OBJECT_ALLFEET, Constant Field Values

ALIGN_OBJECT_ALLFEET

public static final java.lang.String ALIGN_OBJECT_ALLFEET
Align all feet to the edge of the container. The distances (number of units intervening) are summed up for each and every foot.

See Also:
Alignment(String, String, String, String), ALIGN_OBJECT_MAINFOOT, Constant Field Values

ALIGN_CONTAINER_PRWORD

public static final java.lang.String ALIGN_CONTAINER_PRWORD
Alignment constraint aligns objects to the left/right edge of the prosodic word. The prosodic word acts as the container of the alignment.

See Also:
Alignment(String, String, String, String), Constant Field Values

ALIGN_DIRECTION_LEFT

public static final java.lang.String ALIGN_DIRECTION_LEFT
Alignment constraint aligns left edge of object to left edge of container. Prohibit object being to much to the right within the container. Measure the number of units intervening between left edge of container and left edge of object.

See Also:
Alignment(String, String, String, String), ALIGN_DIRECTION_RIGHT, Constant Field Values

ALIGN_DIRECTION_RIGHT

public static final java.lang.String ALIGN_DIRECTION_RIGHT
Alignment constraint aligns right edge of object to right edge of container. Prohibit object being to much to the left within the container. Measure the number of units intervening between right edge of object and right edge of container.

See Also:
Alignment(String, String, String, String), ALIGN_DIRECTION_LEFT, Constant Field Values

ALIGN_UNIT_SYLLABLE

public static final java.lang.String ALIGN_UNIT_SYLLABLE
Alignment constraint measures distances in terms of syllables. Note that the syllables are delineated by the EOS symbol and by the string edges. By definition, this constant is equal to constant MetricalStress.UNIT_SYLL

See Also:
Alignment(String, String, String, String), EOS, ALIGN_UNIT_MORA, UNIT_SYLL, Constant Field Values

ALIGN_UNIT_MORA

public static final java.lang.String ALIGN_UNIT_MORA
Alignment constraint measures distances in terms of moras (morae). Note that moras must be specified using the MORA symbol. By definition, this constant is equal to constant MetricalStress.UNIT_MORA.

See Also:
Alignment(String, String, String, String), MORA, ALIGN_UNIT_SYLLABLE, UNIT_MORA, Constant Field Values

QALIGNMENT

public static final java.lang.String QALIGNMENT
Name of John J. McCarthy's constraint family 'Quantized Alignment'.

See Also:
Constant Field Values

LONGNUCLEUS

public static final int LONGNUCLEUS
Feature 'syllable has a long nucleus'. A long nucleus is at least two vowels, or a vowel followed by a LONG character.

See Also:
LONG, Constant Field Values

CODA

public static final int CODA
Feature 'syllable has a coda'. A coda is a consonant character following a vowel character.

See Also:
Constant Field Values

COMPLEXCODA

public static final int COMPLEXCODA
Feature 'syllable has a complex coda'. A complex coda is at least two consonants (or a consonant followed by a LONG character) following the vowel(s) in the syllable.

See Also:
LONG, Constant Field Values

LONGNUCLEUS_AND_CODA

public static final int LONGNUCLEUS_AND_CODA
Feature 'syllable has a long nucleus, as well as a coda'. A long nucleus is at least two vowels, or a vowel followed by a LONG character. A coda is a consonant character following a vowel character.

See Also:
LONG, Constant Field Values

LONGNUCLEUS_AND_COMPLEXCODA

public static final int LONGNUCLEUS_AND_COMPLEXCODA
Feature 'syllable has a long nucleus, as well as a complex coda'. A long nucleus is at least two vowels, or a vowel followed by a LONG character. A complex coda is at least two consonants (or a consonant followed by a LONG character) following the vowel(s) in the syllable.

See Also:
LONG, Constant Field Values
Constructor Detail

MetricalStress

public MetricalStress()
Metrical stress phonology is created with the default lists of vowels ('a', 'e', 'i', 'o' and 'u') and consonants (all other 21 lower case characters, from 'b' to 'z').


MetricalStress

public MetricalStress(char[] vowellist,
                      char[] consonantlist)
Metrical stress phonology is created with the specified lists of vowels and consonants.

Parameters:
vowellist - List of characters that are to be viewed as vowels.
consonantlist - List of characters that are to be viewed as consonants.
Method Detail

Parse

public Constraint Parse()
Return the constraint 'Parse'. This constraint assigns one violation mark to any syllable not parsed into a foot. Also called 'License-syllable'.

Returns:
Constraint 'Parse Syllable'.

Binary

public Constraint Binary()
Return the constraint 'Foot Binarity'. This constraint assigns one violation mark to any foot that is not binary, which does not consist of two syllables.

Returns:
Constraint 'Binary'.

Binary

public Constraint Binary(java.lang.String unit)

Return the constraint 'Foot Binarity'. This constraint assigns one violation mark to any foot that is not binary, which does not consist of at least two units.

A unit is either a syllable or a mora. Use the constants MetricalStess.UNIT_SYLL and MetricalStess.UNIT_MORA. Under syllabic analysis, the foot must contain an EOS character. (The end-of-foot character precedes the end-of-syllable character of the second syllable.)

Under moraic analysis, a foot not violating the constraint must contain at least two MORA characters. You can use the addMora methods to add the MORA symbols.

Parameters:
unit - Unit of which two is required for this constraint to be satisfied by a foot.
Returns:
Constraint 'Binary'.
See Also:
UNIT_SYLL, UNIT_MORA, addMora(Form, int), addMora(Form, int, int)

BinaryMoraic

public Constraint BinaryMoraic(int heavy)

Return the constraint 'Foot Binarity (moraic)'. This constraint assigns one violation mark to every foot that contains a single light (non-heavy) syllable.

To define what counts as heavy, use the following constants in the argument:

  1. LONGNUCLEUS: syllable is heavy if and only if it has a long nucleus (more vowels characters or a vowel character followed by the LONG character).
  2. CODA: ... if it has coda (a consonant following a vowel).
  3. COMPLEXCODA: ... if it has complex coda (mora consonants or a long consonant following the vowel(s) in the syllable).
  4. LONGNUCLEUS_AND_CODE: ... if it has a long nucleus AND a coda.
  5. LONGNUCLEUS_AND_COMPLEXCODE: ... if it has a long nucleus AND a complex coda.
  6. The sum of the above mentioned constants, meaning OR. For example, LONGNUCLEUS_AND_CODE+COMPLEXCODA means that a syllable is heavy if either it has a complex coda, or it has both a long nucleus and a coda.

Parameters:
heavy - Integer defining what a heavy syllable is. Use one of the constants listed in the see also section.
Returns:
Constraint 'FootBinarity(moraic)': feet contain at least two moras, that is, at least one heavy syllable or two light syllables.
See Also:
Binary(String), LONGNUCLEUS, CODA, COMPLEXCODA, LONGNUCLEUS_AND_CODA, LONGNUCLEUS_AND_COMPLEXCODA

NonFinal

public Constraint NonFinal()
Return the constraint 'NonFinal'. This constraint assigns one violation mark to the candidate, if its last syllable is footed; zero, otherwise. See also constraint 'NonFinalStress', which prohibits stress on the last syllable.

Returns:
Constraint 'NonFinality'.
See Also:
NONFINAL, NonFinalStress()

NonFinalStress

public Constraint NonFinalStress()
Return the constraint 'NonFinalStress'. This constraint assigns one violation mark to the candidate, if its last syllable is stressed; zero, otherwise. See also constraint 'Non-Finality', which prohibits the last syllable to be parsed to a foot.

Returns:
Constraint 'No Final Stress'.
See Also:
NONFINALSTRESS, NonFinal()

NoClash

public Constraint NoClash()
Return the constraint '*Clash'. This constraint assigns one violation mark to any stressed syllable that is immediately preceded by another stressed syllable.

Returns:
Constraint '*Clash': no stressed syllables are adjacent.
See Also:
NOCLASH

NoLapse

public Constraint NoLapse()
Return the constraint '*Lapse'. This constraint assigns one violation mark to any unstressed syllable that is not adjacent to a stressed syllable or to a word edge.

Returns:
Constraint '*Lapse': every unstressed syllable must be adjacent to a stressed syllable or to the word edge.
See Also:
NOLAPSE

Stress_to_weight

public Constraint Stress_to_weight(int heavy)

Return the constraint 'Stress-to-weight'. This constraint assigns one violation mark to every syllable that is stressed but is not heavy according to the definition of a heavy syllable appearing in the argument.

To define what counts as heavy, use the following constants in the argument:

  1. LONGNUCLEUS: syllable is heavy if and only if it has a long nucleus (more vowels characters or a vowel character followed by the LONG character).
  2. CODA: ... if it has coda (a consonant following a vowel).
  3. COMPLEXCODA: ... if it has complex coda (mora consonants or a long consonant following the vowel(s) in the syllable).
  4. LONGNUCLEUS_AND_CODE: ... if it has a long nucleus AND a coda.
  5. LONGNUCLEUS_AND_COMPLEXCODE: ... if it has a long nucleus AND a complex coda.
  6. The sum of the above mentioned constants, meaning OR. For example, LONGNUCLEUS_AND_CODE+COMPLEXCODA means that a syllable is heavy if either it has a complex coda, or it has both a long nucleus and a coda.

Parameters:
heavy - Integer defining what a heavy syllable is. Use one of the constants listed in the see also section.
Returns:
Constraint 'Stress-to-weight': stressed syllables are heavy.
See Also:
WSP(int), LONGNUCLEUS, CODA, COMPLEXCODA, LONGNUCLEUS_AND_CODA, LONGNUCLEUS_AND_COMPLEXCODA

WSP

public Constraint WSP(int heavy)

Return the constraint 'Weight to Stress' (WSP). This constraint assigns one violation mark to each heavy syllable that is unstressed. Heaviness is defined by the argument.

To define what counts as heavy, use the following constants in the argument:

  1. LONGNUCLEUS: syllable is heavy if and only if it has a long nucleus (more vowels characters or a vowel character followed by the LONG character).
  2. CODA: ... if it has coda (a consonant following a vowel).
  3. COMPLEXCODA: ... if it has complex coda (mora consonants or a long consonant following the vowel(s) in the syllable).
  4. LONGNUCLEUS_AND_CODE: ... if it has a long nucleus AND a coda.
  5. LONGNUCLEUS_AND_COMPLEXCODE: ... if it has a long nucleus AND a complex coda.
  6. The sum of the above mentioned constants, meaning OR. For example, LONGNUCLEUS_AND_CODE+COMPLEXCODA means that a syllable is heavy if either it has a complex coda, or it has both a long nucleus and a coda.

Parameters:
heavy - Integer defining what a heavy syllable is. Use one of the constants listed in the see also section.
Returns:
Constraint 'WSP': heavy syllables are stressed.
See Also:
Stress_to_weight(int), LONGNUCLEUS, CODA, COMPLEXCODA, LONGNUCLEUS_AND_CODA, LONGNUCLEUS_AND_COMPLEXCODA

RhType

public Constraint RhType(int type)
Return a constraint in the class 'RhythmType()'. The type is specified in the argument, and must be one of the following: LEFT, RIGHT, NONLEFT, NONRIGHT. One violation mark is assigned to each foot not belonging to the preferred type.

Parameters:
type - Integer specifying the type of the foot. Use one of the four constants (LEFT, RIGHT, NONLEFT, NONRIGHT) mentioned in the see also list.
Returns:
A constraint from the 'RhythmType' family.
See Also:
RHTYPE, RHTYPE_LEFT, RHTYPE_NONLEFT, RHTYPE_RIGHT, RHTYPE_NONRIGHT

Alignment

public Constraint Alignment(java.lang.String object,
                            java.lang.String container,
                            java.lang.String direction,
                            java.lang.String unit)
Alignment constraints. Measures the number of units intervening between the direction edge of container and the direction edge of object, summed up for each object.

Parameters:
object - The objects that have to be aligned to an edge of the container. Use either the constant ALIGNMENT_OBJECT_MAINFOOT (to align the foot containing the primary stress) or the constant ALIGNMENT_OBJECT_ALLFEET (to align all feet).
container - The larger unit to whose edge the object must be aligned. At the moment, you can only use the constant ALIGNMENT_CONTAINER_PRWORD (for prosodic word).
direction - To which edge of the container the objects must align: either ALIGN_DIRECTION_LEFT or ALIGN_DIRECTION_RIGHT.
unit - Units in terms of which the distances from the edge are measured. Currently, either ALIGN_UNIT_SYLLABLE (to count the number of intervening EOS characters) or ALIGN_UNIT_MORA (to count the number of intervening MORA characters).
Returns:
A constraint from the alignment constraint family.
See Also:
ALIGNMENT, ALIGN_OBJECT_MAINFOOT, ALIGN_OBJECT_ALLFEET, ALIGN_CONTAINER_PRWORD, ALIGN_DIRECTION_LEFT, ALIGN_DIRECTION_RIGHT, ALIGN_UNIT_SYLLABLE, ALIGN_UNIT_MORA

QAlignment

public Constraint QAlignment(java.lang.String object,
                             java.lang.String container,
                             java.lang.String direction,
                             java.lang.String unit)
Quantized alignment constraints. Violated (a single time) by an object if and only if at least one unit intervenes between the direction edge of container and the direction edge of object; summed up for each object.

Parameters:
object - The objects that have to be aligned to an edge of the container. Use either the constant ALIGNMENT_OBJECT_MAINFOOT (to align the foot containing the primary stress) or the constant ALIGNMENT_OBJECT_ALLFEET (to align all feet).
container - The larger unit to whose edge the object must be aligned. At the moment, you can only use the constant ALIGNMENT_CONTAINER_PRWORD (for prosodic word).
direction - To which edge of the container the objects must align: either ALIGN_DIRECTION_LEFT or ALIGN_DIRECTION_RIGHT.
unit - Units in terms of which the distances from the edge are measured. Currently, either ALIGN_UNIT_SYLLABLE (to count the number of intervening EOS characters) or ALIGN_UNIT_MORA (to count the number of intervening MORA characters).
Returns:
A constraint from the alignment constraint family.
See Also:
ALIGNMENT, ALIGN_OBJECT_MAINFOOT, ALIGN_OBJECT_ALLFEET, ALIGN_CONTAINER_PRWORD, ALIGN_DIRECTION_LEFT, ALIGN_DIRECTION_RIGHT, ALIGN_UNIT_SYLLABLE, ALIGN_UNIT_MORA

addMora

public Form addMora(Form f,
                    int heavy,
                    int superheavy)

Add MORA symbols to the string in form f, depending on the heaviness of the syllables.

Syllabification using end-of-foot symbols (EOS) and eventual end-of-foot symbols (EOF) is presupposed. Light syllables receive one mora, heavy syllables receive two, and superheavy syllables receive three. The mora symbols follow the segments (vowels and consonants), and preceed the eventual end-of-foot symbols and the end-of-syllable symbols.

To define what counts as heavy, use the following constants in the second and third arguments:

  1. LONGNUCLEUS: has a long nucleus (more vowels characters or a vowel character followed by the LONG character).
  2. CODA: has coda (a consonant following a vowel).
  3. COMPLEXCODA: has complex coda (mora consonants or a long consonant following the vowel(s) in the syllable).
  4. LONGNUCLEUS_AND_CODE: has a long nucleus AND a coda.
  5. LONGNUCLEUS_AND_COMPLEXCODE: has a long nucleus AND a complex coda.
  6. The sum of the above mentioned constants, meaning OR.

The same applies to the definition of what counts as superheavy in the third parameter.

Example: assign two mora symbols to heavy syllables, which have either a long vowel or a coda; but assign three mora symbols to superheavy syllables, which have both:

G.addMora(new Form("bab.[1daab.da].ba:"), MetricalStress.LONGNUCLEUS+MetricalStress.CODA, MetricalStress.LONGNUCLEUS_AND_CODA));
Output: babµµ.[1daab:µµµ.daµ].ba:bµµ

Parameters:
f - Form whose string is incremented with mora symbols
heavy - Definition of what makes a syllable heavy.
superheavy - Definition of what makes a syllable superheavy.
Returns:
A new form with mora symbols added to it.
See Also:
MORA, LONGNUCLEUS, CODA, COMPLEXCODA, LONGNUCLEUS_AND_CODA, LONGNUCLEUS_AND_COMPLEXCODA

addMora

public Form addMora(Form f,
                    int heavy)

Add MORA symbols to the string in form f, depending on the heaviness of the syllables.

Syllabification using end-of-foot symbols (EOS) and eventual end-of-foot symbols (EOF) is presupposed. Light syllables receive one mora and heavy syllables receive two. The mora symbols follow the segments (vowels and consonants), and preceed the eventual end-of-foot symbols and the end-of-syllable symbols.

To define what counts as heavy, use the following constants in the second argument:

  1. LONGNUCLEUS: has a long nucleus (more vowels characters or a vowel character followed by the LONG character).
  2. CODA: has coda (a consonant following a vowel).
  3. COMPLEXCODA: has complex coda (mora consonants or a long consonant following the vowel(s) in the syllable).
  4. LONGNUCLEUS_AND_CODE: has a long nucleus AND a coda.
  5. LONGNUCLEUS_AND_COMPLEXCODE: has a long nucleus AND a complex coda.
  6. The sum of the above mentioned constants, meaning OR.

The same applies to the definition of what counts as superheavy in the third parameter.

Example: assign two mora symbols to heavy syllables, which have either a long vowel or a coda; but assign three mora symbols to superheavy syllables, which have both:

G.addMora( new Form("bab.[1daab.da].ba:"), MetricalStress.LONGNUCLEUS+MetricalStress.CODA );
Output: babµµ.[1daab:µµ.daµ].ba:µµ

Parameters:
f - Form whose string is incremented with mora symbols
heavy - Definition of what makes a syllable heavy.
Returns:
A new form with mora symbols added to it.
See Also:
MORA, LONGNUCLEUS, CODA, COMPLEXCODA, LONGNUCLEUS_AND_CODA, LONGNUCLEUS_AND_COMPLEXCODA