diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-09-08 10:09:26 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-09-08 10:09:26 +0200 |
commit | d04dec688cc9159d4e3ad47890ae4b1f40c5ec3c (patch) | |
tree | fbcea4204d1fd1eaf251ff7e47d6952ec772b78f /src/lib/sounds | |
parent | 80b77d19cee0f3df4457005eead1128b90754a48 (diff) |
Update diphtongue and semi-voyels
Diffstat (limited to 'src/lib/sounds')
-rw-r--r-- | src/lib/sounds/sounds.ml | 124 |
1 files changed, 56 insertions, 68 deletions
diff --git a/src/lib/sounds/sounds.ml b/src/lib/sounds/sounds.ml index 58d511b..2e8e95b 100644 --- a/src/lib/sounds/sounds.ml +++ b/src/lib/sounds/sounds.ml @@ -203,34 +203,21 @@ let semi_voyel_y = kind = SemiVoyel ; code = SemiVoyel_Y} -let nasal t = - - match t.code with - | Voyel_E | E_Opened -> - Some { t with nasal = true } - | Voyel_A -> Some { t with nasal = true } - | Voyel_AI -> Some { t with nasal = true } - | Voyel_O -> Some { t with nasal = true } - | Voyel_I -> Some { t with nasal = true } - | Voyel_Y -> Some { t with nasal = true } - | Diphtonge (s1, s2) -> +let rec nasal t = + + match t.kind, t.code with + | Voyel, Diphtonge (s1, s2) -> begin match s1.code, s2.code with - | (SemiVoyel_W, Voyel_I) -> - (* The only case we could have the nasalisation of such diphtongue, is - the case O I, N -> wich is transformed into O, I N *) - Some ( - diphtongue - semi_voyel_w - { i with nasal = true } ) - | (Voyel_I, Voyel_E) -> + | (SemiVoyel_Y, Voyel_E) -> (* The only case we could have the nasalisation of such diphtongue, is - the case I E, N -> wich is transformed into I, E N *) - Some ( - diphtongue - i - { t with nasal = true } ) + the case I E, N -> wich is transformed into I, I N. *) + Some ( diphtongue s1 { i with nasal = true } ) + | (SemiVoyel_Y, _) + | (SemiVoyel_W, _) -> + Option.map (fun s -> diphtongue s1 s) (nasal s2) | _ -> None end + | Voyel, _ -> Some { t with nasal = true } | _ -> None let muted f = @@ -254,50 +241,51 @@ let repr match letter.code, letter.nasal with - | None, _ -> Repr.none - | Voyel_A, false -> Repr.a - | Voyel_A, true -> Repr.a_nasal - | Voyel_AI, false -> Repr.e_opened - | Voyel_AI, true -> Repr.i_nasal - | E_Closed, _ -> Repr.e_closed - | E_Opened, true | Voyel_E, true -> Repr.a_nasal - | Voyel_E , false -> Repr.schwa - | E_Opened, false -> Repr.e_opened - | Voyel_I, false -> Repr.i - | Voyel_I, true -> Repr.i_nasal - | Voyel_O, true -> Repr.o_nasal - | Voyel_O, false -> Repr.o - | Voyel_U, _ -> Repr.u - | Voyel_Y, false -> Repr.y - | Voyel_Y, true -> Repr.y_nasal - | Voyel_EU_Closed, _ -> Repr.eu_closed - | Voyel_EU_Opened, _ -> Repr.eu_opened - - | SemiVoyel_W, _ -> Repr.semi_voyel_w - | SemiVoyel_Y, _ -> Repr.semi_voyel_y - - | Consonant_P, _ -> Repr.p - | Consonant_B, _ -> Repr.b - | Consonant_T, _ -> Repr.t - | Consonant_D, _ -> Repr.d - | Consonant_K, _ -> Repr.k - | Consonant_G, _ -> Repr.g - | Consonant_F, _ -> Repr.f - | Consonant_V, _ -> Repr.v - | SZ, _ - | Consonant_S, _ -> Repr.s - | Consonant_Z, _ -> Repr.z - - | Consonant_X, _ -> Repr.ch - | Consonant_J, _ -> Repr.j - - | Consonant_M, _ -> Repr.m - | Consonant_N, _ -> Repr.n - | Consonant_GN, _ -> Repr.gn - | Consonant_L, _ -> Repr.l - | Consonant_R, _ -> Repr.r - | Diphtonge (l1, l2), _ -> Repr.diphtongue (_repr l1) (_repr l2) - | Muted t, _ -> Repr.muted (_repr t) + | None , _ -> Repr.none + | Voyel_A , false -> Repr.a + | Voyel_A , true -> Repr.a_nasal + | Voyel_AI , false -> Repr.e_opened + | Voyel_AI , true -> Repr.i_nasal + | E_Closed , _ -> Repr.e_closed + | E_Opened , false -> Repr.e_opened + | E_Opened , true + | Voyel_E , true -> Repr.a_nasal + | Voyel_E , false -> Repr.schwa + | Voyel_I , false -> Repr.i + | Voyel_I , true -> Repr.i_nasal + | Voyel_O , true -> Repr.o_nasal + | Voyel_O , false -> Repr.o + | Voyel_U , _ -> Repr.u + | Voyel_Y , false -> Repr.y + | Voyel_Y , true -> Repr.y_nasal + | Voyel_EU_Closed , _ -> Repr.eu_closed + | Voyel_EU_Opened , _ -> Repr.eu_opened + + | SemiVoyel_W , _ -> Repr.semi_voyel_w + | SemiVoyel_Y , _ -> Repr.semi_voyel_y + + | Consonant_P , _ -> Repr.p + | Consonant_B , _ -> Repr.b + | Consonant_T , _ -> Repr.t + | Consonant_D , _ -> Repr.d + | Consonant_K , _ -> Repr.k + | Consonant_G , _ -> Repr.g + | Consonant_F , _ -> Repr.f + | Consonant_V , _ -> Repr.v + | SZ , _ + | Consonant_S , _ -> Repr.s + | Consonant_Z , _ -> Repr.z + + | Consonant_X , _ -> Repr.ch + | Consonant_J , _ -> Repr.j + + | Consonant_M , _ -> Repr.m + | Consonant_N , _ -> Repr.n + | Consonant_GN , _ -> Repr.gn + | Consonant_L , _ -> Repr.l + | Consonant_R , _ -> Repr.r + | Muted t , _ -> Repr.muted (_repr t) + | Diphtonge (l1, l2), _ -> Repr.diphtongue (_repr l1) (_repr l2) in |