summaryrefslogtreecommitdiff
path: root/src/lib/modifiers/nasal.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-09-04 10:43:01 +0200
committerSébastien Dailly <sebastien@chimrod.com>2021-09-04 10:43:01 +0200
commit0ba049daed6e4b5d01f83d236f3178747bf849cb (patch)
tree72eeedcaa5fbe9736e2842879d62d0bf412a149f /src/lib/modifiers/nasal.ml
parent0b2e63791a073000b70b4463db5d8bce88ab4d23 (diff)
Transform the letter e into eu or E
Diffstat (limited to 'src/lib/modifiers/nasal.ml')
-rw-r--r--src/lib/modifiers/nasal.ml19
1 files changed, 9 insertions, 10 deletions
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 )
| _ ->