Take into account impossible articulations when generating consonants and change a few things.
This commit is contained in:
parent
753d253f1b
commit
8cee7b046a
|
@ -276,20 +276,21 @@ class Consonant:
|
||||||
"""Consonant representation"""
|
"""Consonant representation"""
|
||||||
|
|
||||||
# Simplified model
|
# Simplified model
|
||||||
|
# '%' means impossible articulation
|
||||||
matrixPhonemes = [
|
matrixPhonemes = [
|
||||||
["m", "ɱ", "n", "ɳ", "ɲ", "ŋ", "ɴ", "ɴ"], # nasal
|
["m", "ɱ", "n", "ɳ", "ɲ", "ŋ", "ɴ", "%"], # nasal
|
||||||
["p", "p̪", "t", "ʈ", "c", "k", "q", "ʔ"], # stop voiceless
|
["p", "p̪", "t", "ʈ", "c", "k", "q", "ʔ"], # stop voiceless
|
||||||
["b", "b̪", "d", "ɖ", "ɟ", "ɡ", "ɢ", "ɢ"], # stop voiced
|
["b", "b̪", "d", "ɖ", "ɟ", "ɡ", "ɢ", "%"], # stop voiced
|
||||||
["ɓ", "ɓ̪", "ɗ", "ᶑ", "ʄ", "ɠ", "ʛ", "ʛ"], # stop implosive
|
["ɓ", "ɓ̪", "ɗ", "ᶑ", "ʄ", "ɠ", "ʛ", "%"], # stop implosive
|
||||||
["pf", "tθ", "ts", "ʈʂ", "tʃ", "kx", "qχ", "ʔh"], # affricate voiceless
|
["pf", "tθ", "ts", "ʈʂ", "tʃ", "kx", "qχ", "ʔh"], # affricate voiceless
|
||||||
["bv", "dð", "dz", "ɖʐ", "dʒ", "ɡɣ", "ɢʁ", "ʡʕ" ], # affricate voiced
|
["bv", "dð", "dz", "ɖʐ", "dʒ", "ɡɣ", "ɢʁ", "ʡʕ" ], # affricate voiced
|
||||||
["f", "θ", "s", "ʂ", "ʃ", "x", "χ", "h"], # fricative voiceless
|
["f", "θ", "s", "ʂ", "ʃ", "x", "χ", "h"], # fricative voiceless
|
||||||
["v", "ð", "z", "ʐ", "ʒ", "ɣ", "ʁ", "ɦ"], # fricative voiced
|
["v", "ð", "z", "ʐ", "ʒ", "ɣ", "ʁ", "ɦ"], # fricative voiced
|
||||||
["β", "ʋ", "ɹ", "ɻ", "j", "w", "ʁ", "ʕ"], # approximant
|
["β", "ʋ", "ɹ", "ɻ", "j", "w", "ʁ", "ʕ"], # approximant
|
||||||
["ⱱ", "ⱱ", "ɾ", "ɽ", "ɾ", "ɢ̆", "ɢ̆", "ʡ̮"], # tap/flap
|
["ⱱ", "ⱱ", "ɾ", "ɽ", "%", "%", "ɢ̆", "ʡ̮"], # tap/flap
|
||||||
["ʙ", "ʙ̪", "r", "ɽr", "r", "ʀ", "ʀ", "ʢ"], # trill
|
["ʙ", "ʙ̪", "r", "ɽr", "%", "%", "ʀ", "ʢ"], # trill
|
||||||
["l", "l", "l", "ɭ", "ʎ", "ʟ", "ʟ̠", "ʟ̠"], # lateral
|
["%", "l", "l", "ɭ", "ʎ", "ʟ", "ʟ̠", "%"], # lateral
|
||||||
["ʘ", "ǀ", "ǃ", "ǁ", "ǂ", "ʞ", "ʞ", "ʞ"], # click
|
["ʘ", "ǀ", "ǃ", "ǁ", "ǂ", "ʞ", "%", "%"], # click
|
||||||
]
|
]
|
||||||
|
|
||||||
# left>right: place of articulation:
|
# left>right: place of articulation:
|
||||||
|
@ -371,6 +372,9 @@ class Consonant:
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return "#consonant"
|
return "#consonant"
|
||||||
|
|
||||||
|
def isPossible(manner, place):
|
||||||
|
return '%' != Consonant.matrixPhonemes[manner][place]
|
||||||
|
|
||||||
# Has retroflex consonants ?
|
# Has retroflex consonants ?
|
||||||
retroflexDistribution = phonagen.Distribution()
|
retroflexDistribution = phonagen.Distribution()
|
||||||
retroflexDistribution.addTo(True, 5)
|
retroflexDistribution.addTo(True, 5)
|
||||||
|
@ -399,7 +403,7 @@ voicedDistribution.addTo(False, 5)
|
||||||
# Has click ?
|
# Has click ?
|
||||||
clickDistribution = phonagen.Distribution()
|
clickDistribution = phonagen.Distribution()
|
||||||
clickDistribution.addTo(True, 1)
|
clickDistribution.addTo(True, 1)
|
||||||
clickDistribution.addTo(False, 29)
|
clickDistribution.addTo(False, 69)
|
||||||
|
|
||||||
# Rhotic realisation
|
# Rhotic realisation
|
||||||
rhoticRealisationDistribution = phonagen.Distribution()
|
rhoticRealisationDistribution = phonagen.Distribution()
|
||||||
|
@ -466,7 +470,7 @@ def generateConsonantSet():
|
||||||
for pl in places:
|
for pl in places:
|
||||||
for mn in manners:
|
for mn in manners:
|
||||||
# there is a small chance that a phoneme not on the nominal place will be skipped
|
# there is a small chance that a phoneme not on the nominal place will be skipped
|
||||||
if (pl == nominalPlace) or (random.randrange(8) != 0):
|
if Consonant.isPossible(mn, pl) and ((pl == nominalPlace) or (random.randrange(8) != 0)):
|
||||||
cons = Consonant(mn, pl)
|
cons = Consonant(mn, pl)
|
||||||
# there may be some modifications on the manner or place depending on how contrastive are the consonants
|
# there may be some modifications on the manner or place depending on how contrastive are the consonants
|
||||||
if (not hasSeparateAffricates) and (pl == Consonant.palatal) and (random.randrange(10) < 8):
|
if (not hasSeparateAffricates) and (pl == Consonant.palatal) and (random.randrange(10) < 8):
|
||||||
|
@ -524,17 +528,17 @@ def addSimpleLatinTranscription(transcriptions, phonemeList):
|
||||||
["ṽ", "ṽ", "r", "ř", "r", "gy", "gr", "hg"], # tap/flap
|
["ṽ", "ṽ", "r", "ř", "r", "gy", "gr", "hg"], # tap/flap
|
||||||
["br", "br", "rr", "řr", "ry", "ŕr", "ŕr", "hŕ"], # trill
|
["br", "br", "rr", "řr", "ry", "ŕr", "ŕr", "hŕ"], # trill
|
||||||
["l", "l", "l", "ľ", "ly", "ĺl", "ĺl", "ĺl"], # lateral
|
["l", "l", "l", "ľ", "ly", "ĺl", "ĺl", "ĺl"], # lateral
|
||||||
["ʘ", "ǀ", "ǃ", "ǁ", "ǂ", "ʞ", "ʞ", "ʞ"], # click
|
["p*", "ṕ*", "t*", "ť*", "c*", "k*", "q*", "q*"], # click
|
||||||
]
|
]
|
||||||
nasalSign = random.choice(["\u0328", "\u0330", "n"]) # combining ogonek, combining tilde below, n
|
nasalSign = random.choice(["\u0328", "\u0330", "n"]) # combining ogonek, combining tilde below, n
|
||||||
for ph in phonemeList:
|
for ph in phonemeList:
|
||||||
tr = ""
|
tr = ""
|
||||||
if isinstance(ph, Vowel):
|
if isinstance(ph, Vowel):
|
||||||
tr = vowelTranslationMatrix[ph.height][ph.backness]
|
tr = vowelTranslationMatrix[ph.height][ph.backness]
|
||||||
if ph.isNasal:
|
|
||||||
tr = tr + nasalSign
|
|
||||||
if ph.isLong:
|
if ph.isLong:
|
||||||
tr = tr + tr # Double
|
tr = tr + tr # Double
|
||||||
|
if ph.isNasal:
|
||||||
|
tr = tr + nasalSign
|
||||||
if isinstance(ph, Consonant):
|
if isinstance(ph, Consonant):
|
||||||
tr = consonantTranslationMatrix[ph.manner][ph.place]
|
tr = consonantTranslationMatrix[ph.manner][ph.place]
|
||||||
if ph.isAspirated:
|
if ph.isAspirated:
|
||||||
|
|
Loading…
Reference in New Issue