From 0ba049daed6e4b5d01f83d236f3178747bf849cb Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sat, 4 Sep 2021 10:43:01 +0200 Subject: Transform the letter e into eu or E --- src/lib/modifiers/nasal.ml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/lib/modifiers/nasal.ml') diff --git a/src/lib/modifiers/nasal.ml b/src/lib/modifiers/nasal.ml index 57a3235..cc29efc 100644 --- a/src/lib/modifiers/nasal.ml +++ b/src/lib/modifiers/nasal.ml @@ -1,14 +1,13 @@ -module T = Sounds (* Remove the ending consonant, and transform the voyel into the nasal form *) let transform : Sounds.t Sig.consonants option -> Sounds.t Sig.t -> Sounds.t Sig.t = fun c init -> - let (((v1, v2), _) , _) = init in + let ((v, _) , _) = init in - begin match T.nasal v1, T.nasal v2 with - | Some t1, Some t2 -> - ( ( (t1, t2) + begin match Sounds.nasal v with + | Some t -> + ( ( t , c ) , None ) | _ -> init @@ -22,14 +21,14 @@ let transform let process : 'a Sig.modifier = fun init -> - let (((v1, v2), c) , ending) = init in + let ((v, c) , ending) = init in let ending = Option.bind ending (fun x -> x) in let opening = Option.map (fun v -> v.Sig.opening) c in - let is_voyel = T.is_voyel v1 && T.is_voyel v2 in + let is_voyel = Sounds.is_voyel v in match ending, is_voyel, opening with - | Some ending, _, _ when T.is_nasal ending -> + | Some ending, _, _ when Sounds.is_nasal ending -> transform c init - | None, false, Some (opening::tl) when T.is_nasal opening -> + | None, false, Some (opening::tl) when Sounds.is_nasal opening -> (* If there is no voyel here, transform the opening consonant as an ending consonant for the next syllabus *) let c = Option.map @@ -38,7 +37,7 @@ let process Sig.opening = tl ; Sig.ending = (Some (Some opening)) }) c in - ( ( (v1, v2) + ( ( v , c ) , None ) | _ -> -- cgit v1.2.3