From f68d06c6418e3d025e81e819183dfa049605bfa0 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 14 Sep 2021 13:46:38 +0200 Subject: Corrections --- src/lib/sounds/sounds.ml | 29 ++++++++++++++++++----------- src/lib/sounds/sounds.mli | 5 ++++- 2 files changed, 22 insertions(+), 12 deletions(-) (limited to 'src/lib/sounds') diff --git a/src/lib/sounds/sounds.ml b/src/lib/sounds/sounds.ml index cc801dd..aad7cf0 100644 --- a/src/lib/sounds/sounds.ml +++ b/src/lib/sounds/sounds.ml @@ -116,14 +116,11 @@ let voyel_u = let p = { none with - code = Consonant_P - ; mutable_ = false } + code = Consonant_P } let b = { none with - code = Consonant_B - ; mutable_ = false - } + code = Consonant_B } let t = { none with @@ -143,6 +140,11 @@ let g = { none with code = Consonant_G } +(** f is alway pronounend in ending consonant. Know exeception are : + - cerf + - clef + - nerf + - serf *) let f = { none with code = Consonant_F @@ -227,18 +229,23 @@ let rec nasal t = | Voyel, _ -> Some { t with nasal = true } | _ -> None -let muted f = - (* f is alway pronounend in endding consonant. Know exeception are : - - cerf - - clef - - nerf - - serf *) +let is_muted t = + match t.code with + | Muted _ -> true + | _ -> false + +let mute f = match f.mutable_ with | false -> f | true -> { none with code = Muted f } +let unmute t = + match t.code with + | Muted t -> t + | _ -> t + let repr : (module Sig.REPR) -> t list -> string = fun m letters -> diff --git a/src/lib/sounds/sounds.mli b/src/lib/sounds/sounds.mli index 3b7b760..fb902cb 100644 --- a/src/lib/sounds/sounds.mli +++ b/src/lib/sounds/sounds.mli @@ -1,7 +1,6 @@ module Sig = Sig type t -val muted : t -> t val a : t val e : [`Closed | `Opened] -> t @@ -75,5 +74,9 @@ val semi_voyel_u: t val is_voyel : t -> bool val is_nasal : t -> bool +val is_muted : t -> bool +val mute : t -> t +val unmute: t -> t + val repr : (module Sig.REPR) -> t list -> string -- cgit v1.2.3