summaryrefslogtreecommitdiff
path: root/src/lib/modifiers/e.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/modifiers/e.ml')
-rw-r--r--src/lib/modifiers/e.ml33
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