-
Notifications
You must be signed in to change notification settings - Fork 0
/
Phoneme.py
67 lines (57 loc) · 2.3 KB
/
Phoneme.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'''
Vowel evolution program consonant class.
Run in PYTHON 3(!)
with Vowel, Game_fns, Prototype, Word, Agent, Convention, graphics files in same directory
import time, random, re from Python library
Last update June 2016 HJMS
'''
def Phoneme:
def __init__(self, features):
self.set_features()
for feat in self.features:
feat = False
fm = self.feature_matrix
for f in features:
if f in fm:
fm[f] = True
def set_features(self):
self.features= [self.lateral,
self.rhotic,
self.fricative,
self.stop,
self.strident,
self.nasal,
self.labial,
self.round,
self.coronal,
self.posterior,
self.laminal,
self.dorsal,
self.front,
self.high,
self.low,
self.retracted,
self.voice,
self.spread_glottis,
self.constricted_glottis,
]
self.matrix = {"lateral": self.lateral,
"rhoict": self.rhotic,
"fricative": self.fricative,
"stop": self.stop,
"strident": self.strident,
"nasal": self.nasal,
"labial": self.labial,
"round": self.round,
"coronal": self.coronal,
"posterior": self.posterior,
"laminal": self.laminal,
"dorsal": self.dorsal,
"front": self.front,
"high": self.high,
"low": self.low,
"retracted": self.retracted,
"voice": self.voice,
"spread": self.spread_glottis,
"constricted": self.constricted_glottis
}