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/nasal.ml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/lib/modifiers/nasal.ml (limited to 'src/lib/modifiers/nasal.ml') diff --git a/src/lib/modifiers/nasal.ml b/src/lib/modifiers/nasal.ml new file mode 100644 index 0000000..da24863 --- /dev/null +++ b/src/lib/modifiers/nasal.ml @@ -0,0 +1,23 @@ +(** The Nasal modifier transform a voyel followed by N and a consonant + into a nasal voyel. + + Does this min that nasal voyel are not a distinct element, but just a + merge from two distinct elements ? *) +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 ending = Option.bind ending (fun x -> x) in + match ending with + | None -> init + | Some ending -> + match T.is_nasal ending with + | false -> init + | true -> + (* Remove the ending consonant, and transform the voyel into + the nasal form *) + ( ( (T.nasal v1, T.nasal v2) + , c ) + , None ) + -- cgit v1.2.3