|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hu.birot.OTKit.otBuildingBlocks.Grammar hu.birot.OTKit.grammarExamples.MetricalStress
public class MetricalStress
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:
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):
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 |
---|
public char EOS
.
, 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).
public char BOF
public char EOF
public char PRS
1
'.
public char SCS
2
'.
public char LONG
:
'.
public char MORA
public char SYLL
public MapForm base
public Gen gen
public Topology topology
public MapForm utter
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.
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
.
public static final java.lang.String PARSE
public static final java.lang.String BINARY
public static final java.lang.String UNIT_SYLL
Binary(char)
.
public static final java.lang.String UNIT_MORA
Binary(char)
.
public static final java.lang.String NONFINAL
NONFINALSTRESS
,
NonFinal()
,
Constant Field Valuespublic static final java.lang.String NONFINALSTRESS
NONFINAL
,
NonFinalStress()
,
Constant Field Valuespublic static final java.lang.String NOCLASH
NoClash()
,
Constant Field Valuespublic static final java.lang.String NOLAPSE
NoLapse()
,
Constant Field Valuespublic static final java.lang.String STRESS_TO_WEIGHT
Stress_to_weight(int)
,
Constant Field Valuespublic static final java.lang.String WSP
WSP(int)
,
Constant Field Valuespublic static final int RHTYPE_LEFT
public static final int RHTYPE_RIGHT
public static final int RHTYPE_NONLEFT
public static final int RHTYPE_NONRIGHT
public static final java.lang.String RHTYPE
RhType(int)
,
Constant Field Valuespublic static final java.lang.String ALIGNMENT
public static final java.lang.String ALIGN_OBJECT_MAINFOOT
Alignment(String, String, String, String)
,
ALIGN_OBJECT_ALLFEET
,
Constant Field Valuespublic static final java.lang.String ALIGN_OBJECT_ALLFEET
Alignment(String, String, String, String)
,
ALIGN_OBJECT_MAINFOOT
,
Constant Field Valuespublic static final java.lang.String ALIGN_CONTAINER_PRWORD
Alignment(String, String, String, String)
,
Constant Field Valuespublic static final java.lang.String ALIGN_DIRECTION_LEFT
Alignment(String, String, String, String)
,
ALIGN_DIRECTION_RIGHT
,
Constant Field Valuespublic static final java.lang.String ALIGN_DIRECTION_RIGHT
Alignment(String, String, String, String)
,
ALIGN_DIRECTION_LEFT
,
Constant Field Valuespublic static final java.lang.String ALIGN_UNIT_SYLLABLE
EOS
symbol and by the string edges.
By definition, this constant is equal to constant MetricalStress.UNIT_SYLL
Alignment(String, String, String, String)
,
EOS
,
ALIGN_UNIT_MORA
,
UNIT_SYLL
,
Constant Field Valuespublic static final java.lang.String ALIGN_UNIT_MORA
MORA
symbol.
By definition, this constant is equal to constant MetricalStress.UNIT_MORA
.
Alignment(String, String, String, String)
,
MORA
,
ALIGN_UNIT_SYLLABLE
,
UNIT_MORA
,
Constant Field Valuespublic static final java.lang.String QALIGNMENT
public static final int LONGNUCLEUS
LONG
,
Constant Field Valuespublic static final int CODA
public static final int COMPLEXCODA
LONG
,
Constant Field Valuespublic static final int LONGNUCLEUS_AND_CODA
LONG
,
Constant Field Valuespublic static final int LONGNUCLEUS_AND_COMPLEXCODA
LONG
,
Constant Field ValuesConstructor Detail |
---|
public MetricalStress()
public MetricalStress(char[] vowellist, char[] consonantlist)
vowellist
- List of characters that are to be viewed as vowels.consonantlist
- List of characters that are to be viewed as consonants.Method Detail |
---|
public Constraint Parse()
public Constraint 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.
unit
- Unit of which two is required for this constraint to be satisfied by a foot.
UNIT_SYLL
,
UNIT_MORA
,
addMora(Form, int)
,
addMora(Form, int, int)
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:
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).
CODA
: ... if it has coda (a consonant following a vowel).
COMPLEXCODA
: ... if it has complex coda (mora consonants or a long consonant following the vowel(s) in the syllable).
LONGNUCLEUS_AND_CODE
: ... if it has a long nucleus AND a coda.
LONGNUCLEUS_AND_COMPLEXCODE
: ... if it has a long nucleus AND a complex coda.
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.
heavy
- Integer defining what a heavy syllable is. Use one of the constants listed
in the see also section.
Binary(String)
,
LONGNUCLEUS
,
CODA
,
COMPLEXCODA
,
LONGNUCLEUS_AND_CODA
,
LONGNUCLEUS_AND_COMPLEXCODA
public Constraint NonFinal()
NONFINAL
,
NonFinalStress()
public Constraint NonFinalStress()
NONFINALSTRESS
,
NonFinal()
public Constraint NoClash()
NOCLASH
public Constraint NoLapse()
NOLAPSE
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:
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).
CODA
: ... if it has coda (a consonant following a vowel).
COMPLEXCODA
: ... if it has complex coda (mora consonants or a long consonant following the vowel(s) in the syllable).
LONGNUCLEUS_AND_CODE
: ... if it has a long nucleus AND a coda.
LONGNUCLEUS_AND_COMPLEXCODE
: ... if it has a long nucleus AND a complex coda.
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.
heavy
- Integer defining what a heavy syllable is. Use one of the constants listed
in the see also section.
WSP(int)
,
LONGNUCLEUS
,
CODA
,
COMPLEXCODA
,
LONGNUCLEUS_AND_CODA
,
LONGNUCLEUS_AND_COMPLEXCODA
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:
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).
CODA
: ... if it has coda (a consonant following a vowel).
COMPLEXCODA
: ... if it has complex coda (mora consonants or a long consonant following the vowel(s) in the syllable).
LONGNUCLEUS_AND_CODE
: ... if it has a long nucleus AND a coda.
LONGNUCLEUS_AND_COMPLEXCODE
: ... if it has a long nucleus AND a complex coda.
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.
heavy
- Integer defining what a heavy syllable is. Use one of the constants listed
in the see also section.
Stress_to_weight(int)
,
LONGNUCLEUS
,
CODA
,
COMPLEXCODA
,
LONGNUCLEUS_AND_CODA
,
LONGNUCLEUS_AND_COMPLEXCODA
public Constraint RhType(int type)
type
- Integer specifying the type of the foot. Use one of the four constants (LEFT, RIGHT, NONLEFT, NONRIGHT) mentioned in the
see also list.
RHTYPE
,
RHTYPE_LEFT
,
RHTYPE_NONLEFT
,
RHTYPE_RIGHT
,
RHTYPE_NONRIGHT
public Constraint Alignment(java.lang.String object, java.lang.String container, java.lang.String direction, java.lang.String unit)
units
intervening between
the direction
edge of container
and the
direction
edge of object
, summed up for each object
.
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).
ALIGNMENT
,
ALIGN_OBJECT_MAINFOOT
,
ALIGN_OBJECT_ALLFEET
,
ALIGN_CONTAINER_PRWORD
,
ALIGN_DIRECTION_LEFT
,
ALIGN_DIRECTION_RIGHT
,
ALIGN_UNIT_SYLLABLE
,
ALIGN_UNIT_MORA
public Constraint QAlignment(java.lang.String object, java.lang.String container, java.lang.String direction, java.lang.String unit)
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
.
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).
ALIGNMENT
,
ALIGN_OBJECT_MAINFOOT
,
ALIGN_OBJECT_ALLFEET
,
ALIGN_CONTAINER_PRWORD
,
ALIGN_DIRECTION_LEFT
,
ALIGN_DIRECTION_RIGHT
,
ALIGN_UNIT_SYLLABLE
,
ALIGN_UNIT_MORA
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:
LONGNUCLEUS
: has a long nucleus (more vowels characters or a vowel character followed by the LONG character).
CODA
: has coda (a consonant following a vowel).
COMPLEXCODA
: has complex coda (mora consonants or a long consonant following the vowel(s) in the syllable).
LONGNUCLEUS_AND_CODE
: has a long nucleus AND a coda.
LONGNUCLEUS_AND_COMPLEXCODE
: has a long nucleus AND a complex coda.
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µµ
f
- Form whose string is incremented with mora symbolsheavy
- Definition of what makes a syllable heavy.superheavy
- Definition of what makes a syllable superheavy.
MORA
,
LONGNUCLEUS
,
CODA
,
COMPLEXCODA
,
LONGNUCLEUS_AND_CODA
,
LONGNUCLEUS_AND_COMPLEXCODA
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:
LONGNUCLEUS
: has a long nucleus (more vowels characters or a vowel character followed by the LONG character).
CODA
: has coda (a consonant following a vowel).
COMPLEXCODA
: has complex coda (mora consonants or a long consonant following the vowel(s) in the syllable).
LONGNUCLEUS_AND_CODE
: has a long nucleus AND a coda.
LONGNUCLEUS_AND_COMPLEXCODE
: has a long nucleus AND a complex coda.
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:µµ
f
- Form whose string is incremented with mora symbolsheavy
- Definition of what makes a syllable heavy.
MORA
,
LONGNUCLEUS
,
CODA
,
COMPLEXCODA
,
LONGNUCLEUS_AND_CODA
,
LONGNUCLEUS_AND_COMPLEXCODA
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |