summaryrefslogtreecommitdiff
path: root/src/lib/modifiers/mute.ml
blob: b89fda735a95807b5fc46b6b7852587fcb9a06c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 init ->
    let ((v, c) , ending) = init in
    let is_voyel = Sounds.is_voyel v in
    match is_voyel, c with
    | false, Some c ->
      let c = { c with Sig.opening = List.map ~f:Sounds.muted c.Sig.opening } in
      ((v, Some c) , ending)
    | _ -> init