LingPy

This documentation is for version 2.0.dev, which is not released yet.

lingpy.sequence.sound_classes.prosodic_weights

lingpy.sequence.sound_classes.prosodic_weights(prostring, factor=0.3, _transform={})

Calculate prosodic weights for each position of a sequence.

Parameters :

prostring : string

A prosodic string as it is returned by prosodic_string().

scale : tuple or list

A tuple or list of floats indicating the degree by which the gaps in the environment of ascending, maximum, and descending sonority should be decreased or increased.

factor : float

A scaling factor by which the specific positions of initial and final should be increased and decreased.

Returns :

weights : list

A list of floats reflecting the modification of the weight for each position.

See also

prosodic_string

Notes

Prosodic weights are specific scaling factors which decrease or increase the gap score of a given segment in alignment analyses (see List2012 or List2012a for a detailed description).

Examples

>>> from lingpy import *
>>> prostring = '#vC>'
>>> prosodic_weights(prostring)
[1.5600000000000001, 1.0, 1.2, 0.69999999999999996]
>>> prosodic_weights(prostring,scale=(4,1,2),factor=0.5)
[6.0, 1, 4, 0.5]

This Page