Basic class for handling sound-class sequences.
Parameters : | seq : str
model : Model
merge_vowels : bool (default=True)
|
---|
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. |