From c8b49eed4cf92e7d2dd01dce779ef84ccae733eb Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 27 Aug 2021 14:37:24 +0200 Subject: Splitted modifiers in own library --- src/lib/modifiers/mute.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/lib/modifiers/mute.ml (limited to 'src/lib/modifiers/mute.ml') diff --git a/src/lib/modifiers/mute.ml b/src/lib/modifiers/mute.ml new file mode 100644 index 0000000..253df21 --- /dev/null +++ b/src/lib/modifiers/mute.ml @@ -0,0 +1,18 @@ +open StdLabels + +(** Mute the last consonant if there is no voyel in the syllabus. + + This modifier is only applied in the first step, and not repeated anymore. +*)let process + : 'a Sig.modifier + = fun (type el) m init -> + let module T = (val m:Sounds.T with type t = el) in + let (((v1, v2), c) , ending) = init in + let is_voyel = T.is_voyel v1 && T.is_voyel v2 in + match is_voyel, c with + | false, Some c -> + let c = { c with Sig.opening = List.map ~f:T.muted c.Sig.opening } in + (((v1, v2), Some c) , ending) + | _ -> init + + -- cgit v1.2.3