LingPy

Sequence Analysis (Sequence)

class lingpy.sequence.Sequence(seq, model=sca, merge_vowels=True)

Basic class for handling sound-class sequences.

Parameters :

seq : str

The input sequence in IPA format.

model : Model

A Model object. Three models are predefined and automatically loaded when loading LingPy:

  • ‘dolgo’ – a model which is based on the sound-class model of Dolgopolsky1986,
  • ‘sca’ – an extension of the “dolgo” sound-class based on List2012a, and
  • ‘asjp’ – an independent sound-class model which is based on the sound-class model of Brown2008 and the empirical data of Brown2011.

merge_vowels : bool (default=True)

Indicate, whether neighboring vowels should be merged into diphtongs, or whether they should be kept separated during the analysis.

Examples

Initialize a sound-class sequence.

>>> from lingpy import *
>>> sca = Sequence('t͡sɔyɡə')

Print out its tokens.

>>> for token in sca.tokens: print(token)
... 
t͡s
ɔy
ɡ
ə

Print out its class-string:

>>> print(sca.classes)
CUKE

Compare the length of the IPA-string with that of the sound-class string.

>>> len(sca) == len(sca.ipa)
False

Access the third element of the sound-class sequence and the IPA-string.

>>> print(sca[3],sca.ipa[3])
ə s

Access the prosodic string of the sequence.

>>> sca.prostring
'#vC>'

Access a trigram representation of the sequence.

>>> sca.trigram
['#CU', 'CUK', 'UKE', 'KE$']

Attributes

ipa str The original format of the input sequence.
tokens list A tokenized version of the input sequence.
classes str A sound-class representation of the input sequence.
prostring str A string-representation of the prosodic environment of the segments.
trigram list A list representing the sequence as a trigram.