glaemscribe 1.0.19 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/glaemresources/charsets/tengwar_ds_annatar.cst +509 -0
  3. data/glaemresources/charsets/tengwar_ds_eldamar.cst +22 -16
  4. data/glaemresources/charsets/tengwar_ds_elfica.cst +461 -0
  5. data/glaemresources/charsets/tengwar_ds_parmaite.cst +500 -0
  6. data/glaemresources/charsets/{tengwar_ds.cst → tengwar_ds_sindarin.cst} +59 -62
  7. data/glaemresources/charsets/tengwar_freemono.cst +176 -0
  8. data/glaemresources/charsets/unicode_runes.cst +1 -0
  9. data/glaemresources/modes/adunaic.glaem +50 -28
  10. data/glaemresources/modes/blackspeech.glaem +156 -82
  11. data/glaemresources/modes/english-ipa.glaem +49 -0
  12. data/glaemresources/modes/french-ipa.glaem +49 -0
  13. data/glaemresources/modes/{oldnorse-medieval.glaem → futhark-runicus.glaem} +4 -4
  14. data/glaemresources/modes/futhark-younger.glaem +129 -0
  15. data/glaemresources/modes/{futhorc.glaem.disabled → futhorc.glaem} +76 -38
  16. data/glaemresources/modes/gothic.glaem +1 -1
  17. data/glaemresources/modes/khuzdul.glaem +1 -1
  18. data/glaemresources/modes/mercian.glaem +31 -16
  19. data/glaemresources/modes/quenya-sarati.glaem +5 -3
  20. data/glaemresources/modes/quenya.glaem +168 -77
  21. data/glaemresources/modes/rlyehian.glaem +41 -43
  22. data/glaemresources/modes/sindarin-beleriand.glaem +39 -17
  23. data/glaemresources/modes/sindarin-daeron.glaem +1 -1
  24. data/glaemresources/modes/{sindarin-classical.glaem → sindarin.glaem} +73 -37
  25. data/glaemresources/modes/telerin.glaem +161 -64
  26. data/glaemresources/modes/valarin-sarati.glaem +1 -1
  27. data/glaemresources/modes/westron.glaem +83 -44
  28. data/glaemresources/modes/westsaxon.glaem +30 -13
  29. data/lib/api/charset.rb +29 -11
  30. data/lib/api/charset_parser.rb +15 -3
  31. data/lib/api/mode.rb +15 -3
  32. data/lib/api/mode_parser.rb +7 -2
  33. data/lib/api/option.rb +15 -1
  34. data/lib/api/post_processor/resolve_virtuals.rb +35 -24
  35. data/lib/api/transcription_pre_post_processor.rb +2 -1
  36. metadata +15 -11
  37. data/glaemresources/modes/blackspeech-annatar.glaem +0 -320
  38. data/glaemresources/modes/futhark-long-branch.glaem.disabled +0 -101
  39. data/glaemresources/modes/futhark-short-twig.glaem.disabled +0 -101
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
28
  \writing "Sarati"
29
29
  \mode "Glaemscrafu"
30
30
  \version "0.0.1"
31
- \authors "Talagan (Benjamin Babut)"
31
+ \authors "Talagan (Benjamin Babut), based on J.R.R. Tolkien"
32
32
 
33
33
  \charset sarati_eldamar true
34
34
 
@@ -23,26 +23,44 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
23
23
  **\
24
24
 
25
25
  \beg changelog
26
- \entry 0.0.2 "Correcting ts/ps sequences to work better with eldamar"
27
- \entry 0.0.3 "Porting to virtual chars"
26
+ \entry "0.0.2" "Correcting ts/ps sequences to work better with eldamar"
27
+ \entry "0.0.3" "Porting to virtual chars"
28
+ \entry "0.0.4" "Added charset support for Annatar"
29
+ \entry "0.0.5" "Added support for the FreeMonoTengwar font"
30
+ \entry "0.1.0" "Added support for the Tengwar Elfica font"
28
31
  \end
29
32
 
30
33
  \** Westron mode for glaemscribe (MAY BE INCOMPLETE) **\
31
34
  \language Westron
32
35
  \writing Tengwar
33
36
  \mode Glaemscrafu
34
- \version 0.0.3
35
- \authors "Talagan (Benjamin Babut)"
37
+ \version "0.1.0"
38
+ \authors "Talagan (Benjamin Babut), based on J.R.R. Tolkien"
36
39
 
37
- \charset tengwar_ds true
38
- \charset tengwar_ds_eldamar false
40
+ \charset tengwar_ds_sindarin true
41
+ \charset tengwar_ds_parmaite false
42
+ \charset tengwar_ds_eldamar false
43
+ \charset tengwar_ds_annatar false
44
+ \charset tengwar_ds_elfica false
45
+ \charset tengwar_freemono false
39
46
 
40
47
  \beg options
48
+
49
+ \beg option reverse_o_u_tehtar U_UP_O_DOWN
50
+ \value O_UP_U_DOWN 1
51
+ \value U_UP_O_DOWN 2
52
+ \end
53
+ \beg option consonant_modification_style CONSONANT_MODIFICATION_STYLE_BAR
54
+ \value CONSONANT_MODIFICATION_STYLE_WAVE 0
55
+ \value CONSONANT_MODIFICATION_STYLE_BAR 1
56
+ \end
57
+
41
58
  \option reverse_numbers true
42
59
  \beg option numbers_base BASE_12
43
60
  \value BASE_10 10
44
61
  \value BASE_12 12
45
62
  \end
63
+
46
64
  \end
47
65
 
48
66
  \beg preprocessor
@@ -72,6 +90,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
72
90
  \beg processor
73
91
 
74
92
  \beg rules litteral
93
+
94
+ \if "consonant_modification_style == CONSONANT_MODIFICATION_STYLE_WAVE"
95
+ {GEMINATE} === GEMINATE_SIGN_TILD
96
+ {NASAL} === NASALIZE_SIGN_TILD
97
+ \else
98
+ {GEMINATE} === GEMINATE_SIGN
99
+ {NASAL} === NASALIZE_SIGN
100
+ \endif
101
+
102
+ \if "reverse_o_u_tehtar == U_UP_O_DOWN"
103
+ {O_LOOP} === O_TEHTA
104
+ {O_LOOP_DOUBLE} === O_TEHTA_DOUBLE
105
+ {U_LOOP} === U_TEHTA
106
+ {U_LOOP_DOUBLE} === U_TEHTA_DOUBLE
107
+ \else
108
+ {O_LOOP} === U_TEHTA
109
+ {O_LOOP_DOUBLE} === U_TEHTA_DOUBLE
110
+ {U_LOOP} === O_TEHTA
111
+ {U_LOOP_DOUBLE} === O_TEHTA_DOUBLE
112
+ \endif
113
+
75
114
  {A} === a
76
115
  {AA} === á
77
116
  {E} === e
@@ -102,16 +141,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
102
141
  {OOU} === {OO}{U} \** ôu **\
103
142
 
104
143
  {SDIPHTHONGS} === {AI} * {AU} * {EI} * {EU} * {IU} * {OI} * {OU} * {UI}
105
- {_SDIPHTONGS_} === YANTA A_TEHTA * URE A_TEHTA * YANTA E_TEHTA * URE E_TEHTA * URE I_TEHTA * YANTA O_TEHTA * URE O_TEHTA * YANTA U_TEHTA
144
+ {_SDIPHTONGS_} === YANTA A_TEHTA * URE A_TEHTA * YANTA E_TEHTA * URE E_TEHTA * URE I_TEHTA * YANTA {O_LOOP} * URE {O_LOOP} * YANTA {U_LOOP}
106
145
 
107
146
  {LDIPHTHONGS} === {AAI} * {AAU} * {EEI} * {EEU} * {OOI} * {OOU}
108
- {_LDIPHTONGS_} === ARA A_TEHTA YANTA * ARA A_TEHTA URE * ARA E_TEHTA YANTA * ARA E_TEHTA URE * ARA O_TEHTA YANTA * ARA O_TEHTA URE
147
+ {_LDIPHTONGS_} === ARA A_TEHTA YANTA * ARA A_TEHTA URE * ARA E_TEHTA YANTA * ARA E_TEHTA URE * ARA {O_LOOP} YANTA * ARA {O_LOOP} URE
109
148
 
110
149
  {VOWELS} === {A} * {E} * {I} * {O} * {U}
111
- {TEHTAR} === A_TEHTA * E_TEHTA * I_TEHTA * O_TEHTA * U_TEHTA
150
+ {TEHTAR} === A_TEHTA * E_TEHTA * I_TEHTA * {O_LOOP} * {U_LOOP}
112
151
 
113
152
  {LVOWELS} === {AA} * {EE} * {II} * {OO} * {UU}
114
- {LTETHAR} === ARA A_TEHTA * ARA E_TEHTA * ARA I_TEHTA * ARA O_TEHTA * ARA U_TEHTA
153
+ {LTETHAR} === ARA A_TEHTA * ARA E_TEHTA * ARA I_TEHTA * ARA {O_LOOP} * ARA {U_LOOP}
115
154
 
116
155
  \** Let' put all vowels/diphthongs in the same basket **\
117
156
  {V_D} === [ {VOWELS} * {LVOWELS} * {SDIPHTHONGS} * {LDIPHTHONGS} ]
@@ -133,14 +172,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
133
172
  [{L1_S}] --> [ {L1_T} ]
134
173
  [{L1_S}]{V_D} --> [ {L1_T} ]{_V_D_}
135
174
 
136
- {L1_G_S} === tt * pp * cch * (c,k)(c,k)
137
- {L1_G_T} === TINCO GEMINATE_SIGN * PARMA GEMINATE_SIGN * CALMA GEMINATE_SIGN * QUESSE GEMINATE_SIGN
175
+ {L1_G_S} === tt * pp * cch * (c,k)(c,k)
176
+ {L1_G_T} === TINCO {GEMINATE} * PARMA {GEMINATE} * CALMA {GEMINATE} * QUESSE {GEMINATE}
138
177
 
139
178
  [{L1_G_S}] --> [ {L1_G_T} ]
140
179
  [{L1_G_S}]{V_D} --> [ {L1_G_T} ]{_V_D_}
141
180
 
142
- {L1_N_S} === nt * mp * nch * (n,ñ)(c,k)
143
- {L1_N_T} === TINCO NASALIZE_SIGN * PARMA NASALIZE_SIGN * CALMA NASALIZE_SIGN * QUESSE NASALIZE_SIGN
181
+ {L1_N_S} === nt * mp * nch * (n,ñ)(c,k)
182
+ {L1_N_T} === TINCO {NASAL} * PARMA {NASAL} * CALMA {NASAL} * QUESSE {NASAL}
144
183
 
145
184
  [{L1_N_S}] --> [ {L1_N_T} ]
146
185
  [{L1_N_S}]{V_D} --> [ {L1_N_T} ]{_V_D_}
@@ -151,14 +190,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
151
190
  [{L2_S}] --> [{L2_T}]
152
191
  [{L2_S}]{V_D} --> [{L2_T}]{_V_D_}
153
192
 
154
- {L2_G_S} === dd * bb * jj * gg
155
- {L2_G_T} === ANDO GEMINATE_SIGN * UMBAR GEMINATE_SIGN * ANGA GEMINATE_SIGN * UNGWE GEMINATE_SIGN
193
+ {L2_G_S} === dd * bb * jj * gg
194
+ {L2_G_T} === ANDO {GEMINATE} * UMBAR {GEMINATE} * ANGA {GEMINATE} * UNGWE {GEMINATE}
156
195
 
157
196
  [{L2_G_S}] --> [{L2_G_T}]
158
197
  [{L2_G_S}]{V_D} --> [{L2_G_T}]{_V_D_}
159
198
 
160
- {L2_N_S} === nd * mb * nj * (n,ñ)g
161
- {L2_N_T} === ANDO NASALIZE_SIGN * UMBAR NASALIZE_SIGN * ANGA NASALIZE_SIGN * UNGWE NASALIZE_SIGN
199
+ {L2_N_S} === nd * mb * nj * (n,ñ)g
200
+ {L2_N_T} === ANDO {NASAL} * UMBAR {NASAL} * ANGA {NASAL} * UNGWE {NASAL}
162
201
 
163
202
  [{L2_N_S}] --> [{L2_N_T}]
164
203
  [{L2_N_S}]{V_D} --> [{L2_N_T}]{_V_D_}
@@ -176,22 +215,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
176
215
  [{L3_2_S}] --> [{L3_2_T}]
177
216
  [{L3_2_S}]{V_D} --> [{L3_2_T}]{_V_D_}
178
217
 
179
- {L3_1G_S} === (thth,tth,þþ) * (ff,phph,pph)
180
- {L3_1G_T} === SULE GEMINATE_SIGN * FORMEN GEMINATE_SIGN
218
+ {L3_1G_S} === (thth,tth,þþ) * (ff,phph,pph)
219
+ {L3_1G_T} === SULE {GEMINATE} * FORMEN {GEMINATE}
181
220
 
182
- {L3_2G_S} === (shsh,ssh) * (k,kh)kh
183
- {L3_2G_T} === AHA GEMINATE_SIGN * HWESTA GEMINATE_SIGN
221
+ {L3_2G_S} === (shsh,ssh) * (k,kh)kh
222
+ {L3_2G_T} === AHA {GEMINATE} * HWESTA {GEMINATE}
184
223
 
185
224
  [{L3_1G_S}] --> [{L3_1G_T}]
186
225
  [{L3_1G_S}]{V_D} --> [{L3_1G_T}]{_V_D_}
187
226
  [{L3_2G_S}] --> [{L3_2G_T}]
188
227
  [{L3_2G_S}]{V_D} --> [{L3_2G_T}]{_V_D_}
189
228
 
190
- {L3_1N_S} === (nth,nþ) * (nf,mf,mph)
191
- {L3_1N_T} === SULE NASALIZE_SIGN * FORMEN NASALIZE_SIGN
229
+ {L3_1N_S} === (nth,nþ) * (nf,mf,mph)
230
+ {L3_1N_T} === SULE {NASAL} * FORMEN {NASAL}
192
231
 
193
- {L3_2N_S} === nsh * (n,ñ)kh
194
- {L3_2N_T} === AHA NASALIZE_SIGN * HWESTA NASALIZE_SIGN
232
+ {L3_2N_S} === nsh * (n,ñ)kh
233
+ {L3_2N_T} === AHA {NASAL} * HWESTA {NASAL}
195
234
 
196
235
  [{L3_1N_S}] --> [{L3_1N_T}]
197
236
  [{L3_1N_S}]{V_D} --> [{L3_1N_T}]{_V_D_}
@@ -204,14 +243,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
204
243
  [{L4_S}] --> [{L4_T}]
205
244
  [{L4_S}]{V_D} --> [{L4_T}]{_V_D_}
206
245
 
207
- {L4_G_S} === (dh,ð)(dh,ð) * vv * (zhzh,zzh) * (ghgh,ggh)
208
- {L4_G_T} === ANTO GEMINATE_SIGN * AMPA GEMINATE_SIGN * ANCA GEMINATE_SIGN * UNQUE GEMINATE_SIGN
246
+ {L4_G_S} === (dh,ð)(dh,ð) * vv * (zhzh,zzh) * (ghgh,ggh)
247
+ {L4_G_T} === ANTO {GEMINATE} * AMPA {GEMINATE} * ANCA {GEMINATE} * UNQUE {GEMINATE}
209
248
 
210
249
  [{L4_G_S}] --> [{L4_G_T}]
211
250
  [{L4_G_S}]{V_D} --> [{L4_G_T}]{_V_D_}
212
251
 
213
- {L4_N_S} === n(dh,ð) * (mv,nv) * nzh * (n,ñ)gh
214
- {L4_N_T} === ANTO NASALIZE_SIGN * AMPA NASALIZE_SIGN * ANCA NASALIZE_SIGN * UNQUE NASALIZE_SIGN
252
+ {L4_N_S} === n(dh,ð) * (mv,nv) * nzh * (n,ñ)gh
253
+ {L4_N_T} === ANTO {NASAL} * AMPA {NASAL} * ANCA {NASAL} * UNQUE {NASAL}
215
254
 
216
255
  [{L4_N_S}] --> [{L4_N_T}]
217
256
  [{L4_N_S}]{V_D} --> [{L4_N_T}]{_V_D_}
@@ -228,8 +267,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
228
267
  [{L5_G_S}] --> [{L5_G_T}]
229
268
  [{L5_G_S}]{V_D} --> [{L5_G_T}]{_V_D_}
230
269
 
231
- {L6_S} === w * y * rr * ww * yy
232
- {L6_T} === VALA * ANNA * ROMEN GEMINATE_SIGN * VALA GEMINATE_SIGN * ANNA GEMINATE_SIGN
270
+ {L6_S} === w * y * rr * ww * yy
271
+ {L6_T} === VALA * ANNA * ROMEN {GEMINATE} * VALA {GEMINATE} * ANNA {GEMINATE}
233
272
  [r * {L6_S}] --> [ ORE * {L6_T}]
234
273
  [r * {L6_S}]{V_D} --> [ ROMEN * {L6_T}]{_V_D_}
235
274
 
@@ -242,29 +281,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
242
281
  z{V_D} --> ESSE_NUQUERNA {_V_D_} \** Before a vowel goes down **\
243
282
  z --> ESSE \** Any other pos, up **\
244
283
 
245
- ns{V_D} --> SILME_NUQUERNA NASALIZE_SIGN {_V_D_}
246
- ns --> SILME_NUQUERNA NASALIZE_SIGN
247
- nz{V_D} --> ESSE_NUQUERNA NASALIZE_SIGN {_V_D_}
248
- nz --> ESSE_NUQUERNA NASALIZE_SIGN
284
+ ns{V_D} --> SILME_NUQUERNA {NASAL} {_V_D_}
285
+ ns --> SILME_NUQUERNA {NASAL}
286
+ nz{V_D} --> ESSE_NUQUERNA {NASAL} {_V_D_}
287
+ nz --> ESSE_NUQUERNA {NASAL}
249
288
 
250
289
  ts --> TINCO ALVEOLAR_SIGN
251
290
  ps --> PARMA ALVEOLAR_SIGN
252
291
  (ks,cs,x) --> QUESSE ALVEOLAR_SIGN
253
292
 
254
- ts{V_D} --> TINCO {_V_D_} ALVEOLAR_SIGN
255
- ps{V_D} --> PARMA {_V_D_} ALVEOLAR_SIGN
293
+ ts{V_D} --> TINCO ALVEOLAR_SIGN {_V_D_}
294
+ ps{V_D} --> PARMA ALVEOLAR_SIGN {_V_D_}
256
295
  (ks,cs,x){V_D} --> QUESSE ALVEOLAR_SIGN {_V_D_}
257
296
 
258
297
  h{V_D} --> HYARMEN {_V_D_}
259
298
  h --> HYARMEN
260
- hh{V_D} --> HYARMEN GEMINATE_SIGN {_V_D_}
261
- hh --> HYARMEN GEMINATE_SIGN
299
+ hh{V_D} --> HYARMEN {GEMINATE} {_V_D_}
300
+ hh --> HYARMEN {GEMINATE}
262
301
 
263
302
  l{V_D} --> LAMBE {_V_D_}
264
303
  l --> LAMBE
265
304
 
266
- ll{V_D} --> LAMBE LAMBE_MARK_TILD {_V_D_}
267
- ll --> LAMBE LAMBE_MARK_TILD
305
+ ll{V_D} --> LAMBE {GEMINATE} {_V_D_}
306
+ ll --> LAMBE {GEMINATE}
268
307
 
269
308
  (hl,lh){V_D} --> ALDA {_V_D_}
270
309
  (hl,lh) --> ALDA
@@ -304,8 +343,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
304
343
  » --> DQUOT_CLOSE
305
344
 
306
345
  - --> PUNCT_DOT
307
- – --> WAVE_MED_SIMPLE
308
- — --> WAVE_MED_DOUBLE
346
+ – --> PUNCT_TILD
347
+ — --> PUNCT_DTILD
309
348
 
310
349
  [ --> PUNCT_PAREN_L
311
350
  ] --> PUNCT_PAREN_R
@@ -29,10 +29,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
29
29
  \language "Old English"
30
30
  \writing "Tengwar"
31
31
  \mode "West Saxon"
32
- \version "0.0.2"
33
- \authors "Talagan (Benjamin Babut)"
32
+ \version "0.1.0"
33
+ \authors "J.R.R. Tolkien, impl. Talagan (Benjamin Babut)"
34
34
 
35
35
  \charset tengwar_ds_eldamar true
36
+ \** Other charsets cannot handle all diacritics we are using here ... **\
37
+
38
+ \beg options
39
+ \beg option consonant_modification_style CONSONANT_MODIFICATION_STYLE_WAVE
40
+ \value CONSONANT_MODIFICATION_STYLE_WAVE 0
41
+ \value CONSONANT_MODIFICATION_STYLE_BAR 1
42
+ \end
43
+ \end
36
44
 
37
45
  \beg preprocessor
38
46
  \** Work exclusively downcase **\
@@ -65,6 +73,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
65
73
  \beg processor
66
74
 
67
75
  \beg rules litteral
76
+
77
+ \if "consonant_modification_style == CONSONANT_MODIFICATION_STYLE_WAVE"
78
+ {GEMINATE} === GEMINATE_SIGN_TILD
79
+ {NASAL} === NASALIZE_SIGN_TILD
80
+ \else
81
+ {GEMINATE} === GEMINATE_SIGN
82
+ {NASAL} === NASALIZE_SIGN
83
+ \endif
84
+
68
85
  {A} === a
69
86
  {AA} === á
70
87
  {E} === e
@@ -134,16 +151,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
134
151
  {L1_KER_2} === ċ * c * k
135
152
  {L1_IMG_2} === CALMA * QUESSE * QUESSE
136
153
 
137
- {L1_KER_1_GEMS} === tt * pp
154
+ {L1_KER_1_GEMS} === tt * pp
138
155
  {L1_IMG_1_GEMS} === TINCO GEMINATE_DOUBLE * PARMA GEMINATE_DOUBLE
139
- {L1_KER_2_GEMS} === ċċ * cc * kk
156
+ {L1_KER_2_GEMS} === ċċ * cc * kk
140
157
  {L1_IMG_2_GEMS} === CALMA GEMINATE_DOUBLE * QUESSE GEMINATE_DOUBLE * QUESSE GEMINATE_DOUBLE
141
158
 
142
159
 
143
160
  {S_VOWELS_WN}[{L1_KER_1}]{S_VOWELS_WN} --> 2,1,3 --> [{L1_IMG_1}]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
144
- {S_VOWELS_WN}[{L1_KER_1_GEMS}] --> 2,1 --> [{L1_IMG_1_GEMS}]{_S_VOWELS_UP_WN_}
161
+ {S_VOWELS_WN}[{L1_KER_1_GEMS}] --> 2,1 --> [{L1_IMG_1_GEMS}]{_S_VOWELS_UP_WN_}
145
162
  {S_VOWELS_WN}[{L1_KER_2}]{S_VOWELS_WN} --> 2,1,3 --> [{L1_IMG_2}]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
146
- {S_VOWELS_WN}[{L1_KER_2_GEMS}] --> 2,1 --> [{L1_IMG_2_GEMS}]{_S_VOWELS_UP_WN_}
163
+ {S_VOWELS_WN}[{L1_KER_2_GEMS}] --> 2,1 --> [{L1_IMG_2_GEMS}]{_S_VOWELS_UP_WN_}
147
164
 
148
165
  {S_VOWELS_WN}[ nt * mp ]{S_VOWELS_WN} --> 2,1,3 --> [ TINCO TILD_SUP_S * PARMA TILD_SUP_S ]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
149
166
  {S_VOWELS_WN}[ nċ * nc ]{S_VOWELS_WN} --> 2,1,3 --> [ CALMA TILD_SUP_S * QUESSE TILD_SUP_S ]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
@@ -159,7 +176,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
159
176
 
160
177
 
161
178
  {S_VOWELS_WN}[{L2_KER}]{S_VOWELS_WN} --> 2,1,3 --> [{L2_IMG}]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
162
- {S_VOWELS_WN}[{L2_KER_GEMS}] --> 2,1 --> [{L2_IMG_GEMS}]{_S_VOWELS_UP_WN_}
179
+ {S_VOWELS_WN}[{L2_KER_GEMS}] --> 2,1 --> [{L2_IMG_GEMS}]{_S_VOWELS_UP_WN_}
163
180
 
164
181
  {S_VOWELS_WN}[ nd * mb * nġ * ng ]{S_VOWELS_WN} --> 2,1,3 --> [ ANDO TILD_SUP_L * UMBAR TILD_SUP_L * ANGA TILD_SUP_L * UNGWE TILD_SUP_L ]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
165
182
 
@@ -177,9 +194,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
177
194
  {L3_IMG_2_GEMS} === AHA GEMINATE_DOUBLE * HWESTA GEMINATE_DOUBLE
178
195
 
179
196
  {S_VOWELS_WN}[{L3_KER_1}]{S_VOWELS_WN} --> 2,1,3 --> [{L3_IMG_1}]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
180
- {S_VOWELS_WN}[{L3_KER_1_GEMS}] --> 2,1 --> [{L3_IMG_1_GEMS}]{_S_VOWELS_UP_WN_}
197
+ {S_VOWELS_WN}[{L3_KER_1_GEMS}] --> 2,1 --> [{L3_IMG_1_GEMS}]{_S_VOWELS_UP_WN_}
181
198
  {S_VOWELS_WN}[{L3_KER_2}]{S_VOWELS_WN} --> 2,1,3 --> [{L3_IMG_2}]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
182
- {S_VOWELS_WN}[{L3_KER_2_GEMS}] --> 2,1 --> [{L3_IMG_2_GEMS}]{_S_VOWELS_UP_WN_}
199
+ {S_VOWELS_WN}[{L3_KER_2_GEMS}] --> 2,1 --> [{L3_IMG_2_GEMS}]{_S_VOWELS_UP_WN_}
183
200
 
184
201
 
185
202
  \** ## 4th Line (Voiced fricatives) **\
@@ -193,7 +210,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
193
210
 
194
211
 
195
212
  {S_VOWELS_WN}[{L4_KER}]{S_VOWELS_WN} --> 2,1,3 --> [{L4_IMG}]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
196
- {S_VOWELS_WN}[{L4_KER_GEMS}] --> 2,1 --> [{L4_IMG_GEMS}]{_S_VOWELS_UP_WN_}
213
+ {S_VOWELS_WN}[{L4_KER_GEMS}] --> 2,1 --> [{L4_IMG_GEMS}]{_S_VOWELS_UP_WN_}
197
214
 
198
215
 
199
216
  \** ## 5th Line (Nasals) **\
@@ -203,7 +220,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
203
220
  {L5_IMG} === NUMEN * MALTA
204
221
 
205
222
  {S_VOWELS_WN}[{L5_KER}]{S_VOWELS_WN} --> 2,1,3 --> [{L5_IMG}]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
206
- {S_VOWELS_WN}[ nn * mm ]{S_VOWELS_WN} --> 2,1,3 --> [ NUMEN TILD_SUP_L * MALTA TILD_SUP_L ]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
223
+ {S_VOWELS_WN}[ nn * mm ]{S_VOWELS_WN} --> 2,1,3 --> [ NUMEN TILD_SUP_L * MALTA TILD_SUP_L ]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
207
224
 
208
225
 
209
226
  \** ## 6th Line (Approximants == fr : Spirantes) **\
@@ -215,7 +232,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
215
232
  {L6_IMG_GEMS} === ORE GEMINATE_DOUBLE * ANNA GEMINATE_DOUBLE
216
233
 
217
234
  {S_VOWELS_WN}[{L6_KER}]{S_VOWELS_WN} --> 2,1,3 --> [{L6_IMG}]{_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
218
- {S_VOWELS_WN}[{L6_KER_GEMS}] --> 2,1 --> [{L6_IMG_GEMS}]{_S_VOWELS_UP_WN_}
235
+ {S_VOWELS_WN}[{L6_KER_GEMS}] --> 2,1 --> [{L6_IMG_GEMS}]{_S_VOWELS_UP_WN_}
219
236
 
220
237
 
221
238
  \** ## Liquids **\
@@ -261,7 +278,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
261
278
  \** ## Various **\
262
279
  \** ## **\
263
280
  {S_VOWELS_WN}h{S_VOWELS_WN} --> 2,1,3 --> HYARMEN {_S_VOWELS_UP_WN_}{_S_VOWELS_DN_WN_}
264
- {S_VOWELS_WN}hh --> 2,1 --> HYARMEN GEMINATE_DOUBLE {_S_VOWELS_UP_WN_}
281
+ {S_VOWELS_WN}hh --> 2,1 --> HYARMEN GEMINATE_DOUBLE {_S_VOWELS_UP_WN_}
265
282
 
266
283
 
267
284
  \** ## X **\
data/lib/api/charset.rb CHANGED
@@ -50,6 +50,8 @@ module Glaemscribe
50
50
  attr_accessor :names
51
51
  attr_accessor :classes
52
52
  attr_accessor :charset
53
+ attr_accessor :reversed
54
+ attr_accessor :default
53
55
 
54
56
  class VirtualClass
55
57
  attr_accessor :target
@@ -57,12 +59,20 @@ module Glaemscribe
57
59
  end
58
60
 
59
61
  def initialize
60
- @classes = {} # result_char_1 => [trigger_char_1, trigger_char_2 ...] , result_char_1 => ...
62
+ @classes = {} # result_char_1 => [trigger_char_1, trigger_char_2 ...] , result_char_1 => ...
61
63
  @lookup_table = {}
64
+ @reversed = false
65
+ @default = nil
62
66
  end
63
67
 
64
68
  def str
65
- VIRTUAL_CHAR_OUTPUT
69
+
70
+ # Will be called if the virtual char could not be replaced and still exists at the end of the transcription chain
71
+ if @default
72
+ @charset[@default].str
73
+ else
74
+ VIRTUAL_CHAR_OUTPUT
75
+ end
66
76
  end
67
77
 
68
78
  def finalize
@@ -83,9 +93,7 @@ module Glaemscribe
83
93
  if rc.nil?
84
94
  @charset.errors << Glaeml::Error.new(@line, "Trigger char #{trigger_char} points to unknown result char #{result_char}.")
85
95
  elsif tc.nil?
86
- @charset.errors << Glaeml::Error.new(@line, "Unknown trigger char #{trigger_char}.")
87
- elsif tc.class == VirtualChar
88
- @charset.errors << Glaeml::Error.new(@line, "Trigger char #{trigger_char} is virtual. This is not supported!")
96
+ @charset.errors << Glaeml::Error.new(@line, "Unknown trigger char #{trigger_char}.")
89
97
  elsif rc.class == VirtualChar
90
98
  @charset.errors << Glaeml::Error.new(@line, "Trigger char #{trigger_char} points to another virtual char #{result_char}. This is not supported!")
91
99
  else
@@ -96,6 +104,14 @@ module Glaemscribe
96
104
  end
97
105
  }
98
106
  }
107
+ if @default
108
+ c = @charset[@default]
109
+ if !c
110
+ @charset.errors << Glaeml::Error.new(@line, "Default char #{@default} does not match any real character in the charset.")
111
+ elsif c.virtual?
112
+ @charset.errors << Glaeml::Error.new(@line, "Default char #{@default} is virtual, it should be real only.")
113
+ end
114
+ end
99
115
  end
100
116
 
101
117
  def [](trigger_char_name)
@@ -127,14 +143,16 @@ module Glaemscribe
127
143
  @chars << c
128
144
  end
129
145
 
130
- def add_virtual_char(line, classes, names)
146
+ def add_virtual_char(line, classes, names, reversed = false, default = nil)
131
147
  return if names.empty? || names.include?("?") # Ignore characters with '?'
132
148
 
133
- c = VirtualChar.new
134
- c.line = line
135
- c.names = names
136
- c.classes = classes # We'll check errors in finalize
137
- c.charset = self
149
+ c = VirtualChar.new
150
+ c.line = line
151
+ c.names = names
152
+ c.classes = classes # We'll check errors in finalize
153
+ c.charset = self
154
+ c.reversed = reversed
155
+ c.default = default
138
156
  @chars << c
139
157
  end
140
158
 
@@ -40,6 +40,8 @@ module Glaemscribe
40
40
  return @charset
41
41
  end
42
42
 
43
+ # TODO : verify charset glaeml like we do with modes
44
+
43
45
  doc.root_node.gpath("char").each { |char_element|
44
46
  code = char_element.args[0].hex
45
47
  names = char_element.args[1..-1].map{|cname| cname.strip }.reject{ |cname| cname.empty? }
@@ -47,15 +49,25 @@ module Glaemscribe
47
49
  }
48
50
 
49
51
  doc.root_node.gpath("virtual").each { |virtual_element|
50
- names = virtual_element.args
51
- classes = []
52
+ names = virtual_element.args
53
+ reversed = false
54
+ default = nil
55
+ classes = []
56
+
52
57
  virtual_element.gpath("class").each { |class_element|
53
58
  vc = Charset::VirtualChar::VirtualClass.new
54
59
  vc.target = class_element.args[0]
55
60
  vc.triggers = class_element.args[1..-1].map{|cname| cname.strip }.reject{ |cname| cname.empty? }
56
61
  classes << vc
57
62
  }
58
- @charset.add_virtual_char(virtual_element.line,classes,names)
63
+ virtual_element.gpath("reversed").each { |reversed_element|
64
+ reversed = true
65
+ }
66
+ virtual_element.gpath("default").each { |default_element|
67
+ default = default_element.args[0]
68
+ }
69
+
70
+ @charset.add_virtual_char(virtual_element.line,classes,names,reversed,default)
59
71
  }
60
72
 
61
73
  @charset.finalize