
// Phonemes for Malayalam
// This inherits from ph_hindi


phoneme @
  vowel  starttype #@  endtype #@
  length 130
  FMT(vowel/@_low)
endphoneme


phoneme y  // epenthetic vowel
  vowel starttype #@ endtype #@
  unstressed
  ipa ɨ
  length 80
  FMT(vowel/u#_4, 80)
endphoneme


phoneme a
  vowel starttype #a endtype #a
  ipa ɐ
  length 130

  IF thisPh(isStressed) OR thisPh(isFirstVowel) OR thisPh(isWordEnd) THEN
    FMT(vowel/a#_2)
  ELSE
    ChangeIfUnstressed(@)

    IF nextPh(m) AND nextPh(isWordEnd) THEN
      ChangePhoneme(@)
    ENDIF

    FMT(vowel/a#_3)
  ENDIF
endphoneme


phoneme a#    // don't reduce to [@]
  vowel starttype #a endtype #a
  ChangePhoneme(a)
endphoneme


phoneme a:
  vowel long starttype #a  endtype #a
  length 300
  FMT(vowel/a_5)
endphoneme


phoneme e
  vowel  starttype #e  endtype #e
  length 130
  FMT(vowel/e)
endphoneme


phoneme e:
  vowel long starttype #e  endtype #e
  length 270
  FMT(vowel/e)
endphoneme


phoneme i
  vowel  starttype #i  endtype #i
  length 130
  FMT(vowel/i_6)
endphoneme

phoneme I
  vowel  starttype #i  endtype #i
  length 130
  FMT(vowel/ii)
endphoneme


phoneme i:
  vowel long starttype #i  endtype #i
  length 270
  FMT(vowel/i)
endphoneme



phoneme o
  vowel  starttype #o  endtype #o
  length 130
  FMT(vowel/o)
endphoneme


phoneme o:
  vowel long starttype #o  endtype #o
  length 300
  FMT(vowel/o)
endphoneme


phoneme u
  vowel  starttype #u  endtype #u
  length 110
  FMT(vowel/u)
endphoneme

phoneme u:
  vowel long starttype #u  endtype #u
  length 280
  FMT(vowel/u)
endphoneme


phoneme aI
  vowel long starttype #a endtype #i
  length 280
  FMT(vdiph/ai)
endphoneme

phoneme aU
  vowel long starttype #a endtype #u
  length 270
  FMT(vdiph/aau_3)
endphoneme


// ?? This is standard [v].  Should be it [v] without the fricative noise?
phoneme v
  import_phoneme base/v
endphoneme

phoneme r
  import_phoneme base/*
endphoneme

phoneme R
  import_phoneme base/R2
endphoneme

phoneme d#   // 'rr' sounds like English 'd'
  import_phoneme base/d
endphoneme
