summaryrefslogtreecommitdiff
path: root/src/lib/sounds.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-08-27 13:15:35 +0200
committerSébastien Dailly <sebastien@chimrod.com>2021-08-27 13:15:35 +0200
commit65d5990607e9542aa847ec7cb684afd3ffdedb8f (patch)
tree47a26877c88e303915bc9545a22b004d8dd8089b /src/lib/sounds.ml
parentdf92da631e9a10a099a72ba846f90adf99d180df (diff)
Update
Diffstat (limited to 'src/lib/sounds.ml')
-rw-r--r--src/lib/sounds.ml101
1 files changed, 74 insertions, 27 deletions
diff --git a/src/lib/sounds.ml b/src/lib/sounds.ml
index 0ee9f5c..a2035b7 100644
--- a/src/lib/sounds.ml
+++ b/src/lib/sounds.ml
@@ -10,6 +10,7 @@ module type T = sig
val o : [`Closed | `Opened] -> t
val schwa : unit -> t
val i : [`Closed | `Opened] -> t
+ val u : t
val nasal: t -> t
@@ -19,6 +20,7 @@ module type T = sig
val p: t
val b: t
val t: t
+ val d: t
val k: t
val f: t
val s: unit -> t
@@ -26,17 +28,22 @@ module type T = sig
val ch: unit -> t
val z: unit -> t
- val n: unit -> t
+ val n: t
+ val m: t
val r: unit -> t
val l: unit -> t
+ val semi_voyel_w: t
+
val is_voyel : t -> bool
val is_nasal : t -> bool
type code =
| None
| SZ
+ | Voyel_A
+ | Voyel_O
val code : t -> code
@@ -50,6 +57,8 @@ module T = struct
type code =
| None
| SZ
+ | Voyel_A
+ | Voyel_O
type t =
{ code : code
@@ -66,8 +75,34 @@ module Repr = struct
let a = "a"
and a_nasal = "@"
+ and o = "o"
and o_nasal = "§"
+ and i = "i"
+ and u = "y"
+
+ and p = "p"
+ and b = "b"
+ and t = "t"
+ and d = "d"
+
+ and k = "k"
+ and g = "g"
+
+ and f = "f"
+
+ and ch = "S"
+
+ and s = "s"
+ and z = "z"
+
+ and m = "m"
+ and n = "n"
+
+ and l = "L"
+ and r = "R"
+
+ and w = "w"
end
module S = struct
@@ -78,18 +113,21 @@ module S = struct
let is_nasal t = t.nasal
let none =
- { repr = "."
+ { repr = ""
; muted = false
; kind = None
; nasal = false
; code = None }
+ let voyel =
+ { none with kind = Voyel }
+
let code t = t.code
let nasal t =
- match t.repr with
- | "a" -> { t with repr = Repr.a_nasal ; nasal = true }
- | "o" -> { t with repr = Repr.o_nasal ; nasal = true }
+ match t.code with
+ | Voyel_A -> { t with repr = Repr.a_nasal ; nasal = true }
+ | Voyel_O -> { t with repr = Repr.o_nasal ; nasal = true }
| _ -> t
let muted f =
@@ -98,64 +136,73 @@ module S = struct
; muted = true }
let a _ =
- { none with repr = Repr.a }
+ { voyel with repr = Repr.a ; code = Voyel_A }
let e = function
- | `Closed -> { none with repr = "e" }
- | `Opened -> { none with repr = "E" }
+ | `Closed -> { voyel with repr = "e" }
+ | `Opened -> { voyel with repr = "E" }
let eu = function
- | `Closed -> { none with repr = "2" }
- | `Opened -> { none with repr = "9" }
+ | `Closed -> { voyel with repr = "2" }
+ | `Opened -> { voyel with repr = "9" }
let schwa () =
- { none with repr = "°" }
+ { voyel with repr = "°" }
let o _ =
- { none with repr = "o" }
+ { voyel with repr = Repr.o ; code = Voyel_O }
let i _ =
- { none with repr = "i" }
+ { voyel with repr = Repr.i }
+
+ let u =
+ { voyel with repr = Repr.u }
let p =
- { none with repr = "p" }
+ { none with repr = Repr.p }
let b =
- { none with repr = "b" }
+ { none with repr = Repr.b }
let t =
- { none with repr = "t" }
+ { none with repr = Repr.t }
+
+ let d =
+ { none with repr = Repr.d }
let k =
- { none with repr = "k" }
+ { none with repr = Repr.k }
let f =
- { none with repr = "f" }
+ { none with repr = Repr.f }
let s () =
- { none with repr = "s" }
+ { none with repr = Repr.s }
let sz () =
{ (s()) with code = SZ }
let ch () =
- { none with repr = "S" }
+ { none with repr = Repr.ch }
let z () =
- { none with repr = "z" }
+ { none with repr = Repr.z }
- let n () =
- { none with
- repr = "n"
- ; nasal = true }
+ let n =
+ { none with repr = Repr.n ; nasal = true }
+
+ let m =
+ { none with repr = Repr.m ; nasal = true }
let l () =
- { none with repr = "L" }
+ { none with repr = Repr.l }
let r () =
- { none with repr = "R" }
+ { none with repr = Repr.r }
+ let semi_voyel_w =
+ { none with repr = Repr.w }
end
include S