diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-09-07 13:44:54 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-09-07 13:44:54 +0200 |
commit | 96a225fb5fa24a71e1b76e0369126b3bcfab5f81 (patch) | |
tree | 7af2de89c02461607666a9442cbaa5fbf2c94678 /src/lib/modifiers | |
parent | e4faaaf8a022fbe2c8c574d2d49155f74aa18a33 (diff) |
Moved the printer to toplevel
Diffstat (limited to 'src/lib/modifiers')
-rw-r--r-- | src/lib/modifiers/e.ml | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/lib/modifiers/e.ml b/src/lib/modifiers/e.ml index 5f6e6fe..bd4a940 100644 --- a/src/lib/modifiers/e.ml +++ b/src/lib/modifiers/e.ml @@ -1,3 +1,23 @@ +(** Transform the ending e. + + For example "ie$" into "i" + +*) +let ending_e + : 'a Sig.modifier + = fun init -> + let ((v, c) , ending) = init in + + if v = Sounds.diphtongue Sounds.semi_voyel_y Sounds.schwa then + ((Sounds.i, c), ending) + else if v = Sounds.schwa then ( + match c, ending with + (* If there is no consonant, and just a final e, remove it *) + | None, None -> ((Sounds.none, c), ending) + | _ -> init + ) else + init + (** Transform the e into eu or E *) let process : 'a Sig.modifier @@ -12,16 +32,5 @@ let process | Some _ when v = Sounds.schwa -> (* If there is an ending consonant, change the e into E like essai *) ((Sounds.e `Opened, c) , ending) - | _ -> init + | _ -> ((v, c) , ending) -(** Transform the final e into E if there is a consonant *) -let ending_e - : 'a Sig.modifier - = fun init -> - let ((v, c) , ending) = init in - - match ending with - | Some _ when v = Sounds.schwa -> - (* If there is an ending consonant, change the e into E like essai *) - ((Sounds.e `Opened, c) , ending) - | _ -> init |