summaryrefslogtreecommitdiff
path: root/src/lib/repr/tengwar.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/repr/tengwar.ml')
-rw-r--r--src/lib/repr/tengwar.ml171
1 files changed, 163 insertions, 8 deletions
diff --git a/src/lib/repr/tengwar.ml b/src/lib/repr/tengwar.ml
index 61fbc87..f9fde05 100644
--- a/src/lib/repr/tengwar.ml
+++ b/src/lib/repr/tengwar.ml
@@ -9,8 +9,7 @@ type category =
| III
type 'a voyel =
- { opened : bool
- ; position : position_type
+ { position : position_type
; app : ('a -> string) }
type 'a consonant =
@@ -118,8 +117,7 @@ let nasal m ng n letter =
{empty_glyph with
tengwa = Some c
; tehta_above = Some letter } in
- g::f::[]
- )
+ g::f::[] )
let diphtongue
: 'a t -> 'a t -> 'a t
@@ -185,6 +183,10 @@ let fold
_fold
(Some {empty_glyph with tengwa = Some c})
tl
+ | Some ({ tehta_below = None ; _} as t), Voyel ({position = `Below; _} as v) ->
+ _fold
+ (Some {t with tehta_below = Some v})
+ tl
| Some ({ tehta_below = Some _ ; _} as t), Voyel ({position = `Below; _} as v) ->
repr_glyph ~portant t buff;
_fold
@@ -200,10 +202,6 @@ let fold
_fold
(Some {empty_glyph with tehta_above = Some v})
tl
- | Some t, Voyel v ->
- _fold
- (Some (add_voyel_to_glyph t v))
- tl
| Some ({ tengwa = None ; _} as t), Consonant c ->
_fold
(Some {t with tengwa = Some c})
@@ -227,3 +225,160 @@ let fold
in
_fold None elems;
Buffer.contents buff
+
+let p repr muted position = Consonant
+ { position
+ ; muted
+ ; category = II
+ ; primary = true
+ ; repr }
+
+and b repr muted position = Consonant
+ { position
+ ; muted
+ ; category = II
+ ; primary = true
+ ; repr }
+
+and t repr muted position = Consonant
+ { position
+ ; muted
+ ; category = I
+ ; primary = true
+ ; repr }
+
+and d repr muted position = Consonant
+ { position
+ ; muted
+ ; category = I
+ ; primary = true
+ ; repr }
+
+and k repr muted position = Consonant
+ { position
+ ; muted
+ ; category = III
+ ; primary = true
+ ; repr }
+
+and g repr muted position = Consonant
+ { position
+ ; muted
+ ; category = III
+ ; primary = true
+ ; repr }
+
+and f repr position = Consonant
+ { position
+ ; muted = None
+ ; category = II
+ ; primary = true
+ ; repr }
+
+and v repr position = Consonant
+ { position
+ ; muted = None
+ ; category = II
+ ; primary = true
+ ; repr }
+
+and ch repr position = Consonant
+ { position
+ ; muted = None
+ ; category = III
+ ; primary = true
+ ; repr }
+
+and j repr position = Consonant
+ { position
+ ; muted = None
+ ; category = III
+ ; primary = true
+ ; repr }
+
+and s repr muted position = Consonant
+ { position
+ ; muted
+ ; category = I
+ ; primary = true
+ ; repr }
+
+and z repr position = Consonant
+ { position
+ ; muted = None
+ ; category = I
+ ; primary = true
+ ; repr }
+
+and m repr position = Consonant
+ { position
+ ; muted = None
+ ; category = II
+ ; primary = true
+ ; repr }
+
+and n repr position = Consonant
+ { position
+ ; muted = None
+ ; category = I
+ ; primary = true
+ ; repr }
+
+and gn repr position = Consonant
+ { position
+ ; muted = None
+ ; category = III
+ ; primary = false
+ ; repr }
+
+and ng repr position = Consonant
+ { position
+ ; muted = None
+ ; category = III
+ ; primary = true
+ ; repr }
+
+and r repr muted position = Consonant
+ { position
+ ; muted
+ ; category = I
+ ; primary = false
+ ; repr }
+
+and semi_voyel_w repr position = Consonant
+ { position
+ ; muted = None
+ ; category = II
+ ; primary = false
+ ; repr }
+
+and semi_voyel_y repr position = Consonant
+ { position
+ ; muted = None
+ ; category = II
+ ; primary = false
+ ; repr }
+
+and semi_voyel_u repr position = Consonant
+ { position
+ ; muted = None
+ ; category = II
+ ; primary = false
+ ; repr }
+
+let l repr position =
+ let default =
+ { position
+ ; muted = None
+ ; category = II
+ ; primary = false
+ ; repr } in
+ Consonant default
+
+let portant repr position =
+ { position
+ ; muted = None
+ ; category = I
+ ; primary = false
+ ; repr }
+