diff --git a/py-phonagen/phonology-maker.py b/py-phonagen/phonology-maker.py index 837faf8..2e3ad36 100755 --- a/py-phonagen/phonology-maker.py +++ b/py-phonagen/phonology-maker.py @@ -276,20 +276,21 @@ class Consonant: """Consonant representation""" # Simplified model + # '%' means impossible articulation matrixPhonemes = [ - ["m", "ɱ", "n", "ɳ", "ɲ", "ŋ", "ɴ", "ɴ"], # nasal + ["m", "ɱ", "n", "ɳ", "ɲ", "ŋ", "ɴ", "%"], # nasal ["p", "p̪", "t", "ʈ", "c", "k", "q", "ʔ"], # stop voiceless - ["b", "b̪", "d", "ɖ", "ɟ", "ɡ", "ɢ", "ɢ"], # stop voiced - ["ɓ", "ɓ̪", "ɗ", "ᶑ", "ʄ", "ɠ", "ʛ", "ʛ"], # stop implosive + ["b", "b̪", "d", "ɖ", "ɟ", "ɡ", "ɢ", "%"], # stop voiced + ["ɓ", "ɓ̪", "ɗ", "ᶑ", "ʄ", "ɠ", "ʛ", "%"], # stop implosive ["pf", "tθ", "ts", "ʈʂ", "tʃ", "kx", "qχ", "ʔh"], # affricate voiceless ["bv", "dð", "dz", "ɖʐ", "dʒ", "ɡɣ", "ɢʁ", "ʡʕ" ], # affricate voiced ["f", "θ", "s", "ʂ", "ʃ", "x", "χ", "h"], # fricative voiceless ["v", "ð", "z", "ʐ", "ʒ", "ɣ", "ʁ", "ɦ"], # fricative voiced ["β", "ʋ", "ɹ", "ɻ", "j", "w", "ʁ", "ʕ"], # approximant - ["ⱱ", "ⱱ", "ɾ", "ɽ", "ɾ", "ɢ̆", "ɢ̆", "ʡ̮"], # tap/flap - ["ʙ", "ʙ̪", "r", "ɽr", "r", "ʀ", "ʀ", "ʢ"], # trill - ["l", "l", "l", "ɭ", "ʎ", "ʟ", "ʟ̠", "ʟ̠"], # lateral - ["ʘ", "ǀ", "ǃ", "ǁ", "ǂ", "ʞ", "ʞ", "ʞ"], # click + ["ⱱ", "ⱱ", "ɾ", "ɽ", "%", "%", "ɢ̆", "ʡ̮"], # tap/flap + ["ʙ", "ʙ̪", "r", "ɽr", "%", "%", "ʀ", "ʢ"], # trill + ["%", "l", "l", "ɭ", "ʎ", "ʟ", "ʟ̠", "%"], # lateral + ["ʘ", "ǀ", "ǃ", "ǁ", "ǂ", "ʞ", "%", "%"], # click ] # left>right: place of articulation: @@ -371,6 +372,9 @@ class Consonant: def getDescription(self): return "#consonant" + def isPossible(manner, place): + return '%' != Consonant.matrixPhonemes[manner][place] + # Has retroflex consonants ? retroflexDistribution = phonagen.Distribution() retroflexDistribution.addTo(True, 5) @@ -399,7 +403,7 @@ voicedDistribution.addTo(False, 5) # Has click ? clickDistribution = phonagen.Distribution() clickDistribution.addTo(True, 1) -clickDistribution.addTo(False, 29) +clickDistribution.addTo(False, 69) # Rhotic realisation rhoticRealisationDistribution = phonagen.Distribution() @@ -466,7 +470,7 @@ def generateConsonantSet(): for pl in places: for mn in manners: # 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) # 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): @@ -524,17 +528,17 @@ def addSimpleLatinTranscription(transcriptions, phonemeList): ["ṽ", "ṽ", "r", "ř", "r", "gy", "gr", "hg"], # tap/flap ["br", "br", "rr", "řr", "ry", "ŕr", "ŕr", "hŕ"], # trill ["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 for ph in phonemeList: tr = "" if isinstance(ph, Vowel): tr = vowelTranslationMatrix[ph.height][ph.backness] - if ph.isNasal: - tr = tr + nasalSign if ph.isLong: tr = tr + tr # Double + if ph.isNasal: + tr = tr + nasalSign if isinstance(ph, Consonant): tr = consonantTranslationMatrix[ph.manner][ph.place] if ph.isAspirated: