This file is indexed.

/usr/share/m17n/bo-ewts.mim is in m17n-db 1.7.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
;; bo-ewts.mim -- Tibetan input method with EWTS
;; Copyright (C) 2007, 2008, 2009
;;   National Institute of Advanced Industrial Science and Technology (AIST)
;;   Registration Number H15PRO112
;; Copyright (C) 2010 Hugues MOISY <hugues.moisy@gmail.com>
;; Copyright (C) 2014 Elie Roux <elie.roux@telecom-bretagne.eu>

;; This file is part of the m17n database; a sub-part of the m17n
;; library.

;; The m17n library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation; either version 2.1 of
;; the License, or (at your option) any later version.

;; The m17n library is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; Lesser General Public License for more details.

;; You should have received a copy of the GNU Lesser General Public
;; License along with the m17n library; if not, write to the Free
;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

(input-method bo ewts)

(description "Tibetan input method based on EWTS.
This implementation is based on THDL Extended Wylie Transliteration Scheme
Version 2.0 <http://www.thlib.org/reference/transliteration/#!essay=/thl/ewts>.")

(title "ཀ")

(variable
 (precomposed
  (_"Flag to tell whether or not to generate precomposed characters.
If 1 (the default), generate precomposed characters (i.e. NFC) if available (e.g. \"ྲྀ\"(U+0F76).
If 0, generate only decomposed characters (i.e. NFD) (e.g. \"ྲྀ\" (U+0FB2 U+0F80).")
  ;; The default should be 1 (i.e NFC) according to:
  ;;   http://www.w3.org/International/questions/qa-html-css-normalization
  ;;   and Unicode Consortium http://www.unicode.org/faq/normalization.html
  1 0 1))

(map
 ;; This map is used also for subjoined consonants.
 (consonant
  ("k" "ཀ")
  ("kh" "ཁ")
  ("g" "ག")
  ("ng" "ང")
  ("c" "ཅ")
  ("ch" "ཆ")
  ("j" "ཇ")
  ("ny" "ཉ")
  ("T" "ཊ")
  ("Th" "ཋ")
  ("D" "ཌ")
  ("N" "ཎ")
  ("t" "ཏ")
  ("th" "ཐ")
  ("d" "ད")
  ("n" "ན")
  ("p" "པ")
  ("ph" "ཕ")
  ("b" "བ")
  ("m" "མ")
  ("ts" "ཙ")
  ("tsh" "ཚ")
  ("dz" "ཛ")
  ("w" "ཝ")
  ("zh" "ཞ")
  ("z" "ཟ")
  ("'" "འ")
  ("y" "ཡ")
  ("r" "ར")
  ("l" "ལ")
  ("sh" "ཤ")
  ("Sh" "ཥ")
  ("s" "ས")
  ("h" "ཧ")
  ("a" "ཨ")
)

 ;; Standard Tibetan Stacks listed at:
 ;; <http://www.thlib.org/reference/transliteration/tibstacks.php>
 (standard-stack
  ("f" "ཕ༹")
  ("v" "བ༹")
  ("R" "ཪ")
  ("rk" "རྐ")
  ("rg" "རྒ")
  ("rng" "རྔ")
  ("rj" "རྗ")
  ("rny" "རྙ")
  ("rt" "རྟ")
  ("rd" "རྡ")
  ("rn" "རྣ ")
  ("rb" "རྦ")
  ("rm" "རྨ")
  ("rts" "རྩ")
  ("rdz" "རྫ")
  ("lk" "ལྐ")
  ("lg" "ལྒ")
  ("lng" "ལྔ")
  ("lc" "ལྕ")
  ("lj" "ལྗ")
  ("lt" "ལྟ")
  ("ld" "སྡ")
  ("lp" "ལྤ")
  ("lb" "ལྦ")
  ("lh" "ལྷ")
  ("sk" "སྐ")
  ("sg" "སྒ")
  ("sng" "སྔ")
  ("sny" "སྙ")
  ("st" "སྟ")
  ("sd" "སྡ")
  ("sn" "སྣ")
  ("sp" "སྤ")
  ("sb" "སྦ")
  ("sm" "སྨ")
  ("sts" "སྩ")
  ("kw" "ཀྭ")
  ("khw" "ཁྭ")
  ("gw" "གྭ")
  ("cw" "ཅྭ")
  ("nyw" "ཉྭ")
  ("tw" "ཏྭ")
  ("dw" "དྭ")
  ("tsw" "ཙྭ")
  ("tshw" "ཚྭ")
  ("zhw" "ཞྭ")
  ("zw" "ཟྭ")
  ("rw" "རྭ")
  ("shw" "ཤྭ")
  ("sw" "སྭ")
  ("hw" "ཧྭ")
  ("ky" "ཀྱ")
  ("khy" "ཁྱ")
  ("gy" "གྱ")
  ("py" "པྱ")
  ("phy" "ཕྱ")
  ("by" "བྱ")
  ("my" "མྱ")
  ("kr" "ཀྲ")
  ("khr" "ཁྲ")
  ("gr" "གྲ")
  ("tr" "ཏྲ")
  ("thr" "ཐྲ")
  ("dr" "དྲ")
  ("pr" "པྲ")
  ("phr" "ཕྲ")
  ("br" "བྲ")
  ("mr" "མྲ")
  ("shr" "ཤྲ")
  ("sr" "སྲ")
  ("hr" "ཧྲ")
  ("kl" "ཀླ")
  ("gl" "གླ")
  ("bl" "བླ")
  ("zl" "ཟླ")
  ("rl" "རླ")
  ("sl" "སླ")
  ("rky" "རྐྱ")
  ("rgy" "རྒྱ")
  ("rmy" "རྨྱ")
  ("rgw" "རྒྭ")
  ("rtsw" "རྩྭ")
  ("sky" "སྐྱ")
  ("sgy" "སྒྱ")
  ("spy" "སྤྱ")
  ("sby" "སྦྱ")
  ("smy" "སྨྱ")
  ("skr" "སྐྲ")
  ("sgr" "སྒྲ")
  ("snr" "སྣྲ")
  ("spr" "སྤྲ")
  ("sbr" "སྦྲ")
  ("smr" "སྨྲ")
  ("grw" "གྲྭ")
  ("drw" "དྲྭ")
  ("phyw" "ཕྱྭ")
  ;; ambiguous cases with b as prefix
  ("brk" "བརྐ")
  ("brg" "བརྒ")
  ("brng" "བརྔ")
  ("brj" "བརྗ")
  ("brl" "བརླ")
  ("brny" "བརྙ")
  ("brt" "བརྟ")
  ("brd" "བརྡ")
  ("brn" "བརྣ ")
  ("brts" "བརྩ")
  ("brdz" "བརྫ")
  ("brky" "བརྐྱ")
  ("brgy" "བརྒྱ")
  ("blt" "བལྟ")
  ("bld" "བལྡ")
  ("brtsw" "བརྩྭ")
  ("brgw" "བརྒྭ")
  ;; oM
  ("oM" (cond ((= precomposed 0) "ཨོཾ") (1 "ༀ")))
)

 (force-stack
  ("+"))

 (break-stack
  ("."))

 (special-subjoined
  ("h" (cond ((= precomposed 0) "ྷ")
	     ((= @-1 ?ག) (delete @-1) "གྷ")
	     ((= @-1 ?ད) (delete @-1)  "དྷ")
	     ((= @-1 ?ཌ) (delete @-1)  "ཌྷ")
	     ((= @-1 ?བ) (delete @-1)  "བྷ")
	     ((= @-1 ?ཛ) (delete @-1)  "ཛྷ")
	     ((= @-1 ?ྒ) (delete @-1) "ྒྷ")
	     ((= @-1 ?ྡ) (delete @-1)  "ྡྷ")
	     ((= @-1 ?ྜ) (delete @-1)  "ྜྷ")
	     ((= @-1 ?ྦ) (delete @-1)  "ྦྷ")
	     ((= @-1 ?ྫ) (delete @-1)  "ྫྷ")
	     (1 "ྷ")))
  ("Sh" (cond ((= precomposed 0) "ྵ")
	      ((= @-1 ?ཀ) (delete @-1) "ཀྵ")
	      ((= @-1 ?ྐ) (delete @-1) "ྐྵ")
	      (1 "ྵ")))
  ("v" "ྦ༹")
  ("f" "ྥ༹")
  ("W" "ྺ")
  ("Y" "ྻ")
  ("R" "ྼ")
  ("Z" "༹"))

 (vowel
  ("a" "")
  ("-i" (cond ((= precomposed 0) "ྀ")
	      ((= @-1 ?ྲ) "ྲྀ")
	      ((= @-1 ?ླ) "ླྀ")
	      (1 "ྀ")))
  ("u" "ུ")
  ("e" "ེ")
  ("o" "ོ")
  ("i" "ི")
  ("A" "ཱ")
  ("I" "ཱི")
  ("U" "ཱུ")
  ("ai" "ཻ")
  ("au" "ཽ")
  ("uo" "ོུ")
  ("ui" "ིུ")
  ("ue" "ེུ")
  ("r-I" "ྲཱྀ")
  ("l-I" "ླཱྀ")
  ("-I" "ཱྀ"))

 (others
  ;; Numbers
  ("0" "༠")
  ("1" "༡")
  ("2" "༢")
  ("3" "༣")
  ("4" "༤")
  ("5" "༥")
  ("6" "༦")
  ("7" "༧")
  ("8" "༨")
  ("9" "༩")
  ;; These half numbers are not in EWTS but for convenience.
  ("-1" "༪")
  ("-2" "༫")
  ("-3" "༬")
  ("-4" "༭")
  ("-5" "༮")
  ("-6" "༯")
  ("-7" "༰")
  ("-8" "༱")
  ("-9" "༲")
  ("-0" "༳")
  ;; Sanskrit-related marks
  ("H" "ཿ")
  ("M" "ཾ")
  ("~M" "ྃ")
  ("~M`" "ྂ")
  ("?" "྄")
  ("&" "྅")
  ;; Intersyllabic marks
  (" " "་")
  ("*" "༌")
  ;; Phrase deliminating marks
  ("/" "།")
  ("//" "༎")
  (";" "༏")
  ("|" "༑")
  ("!" "༈")
  (":" "༔")
  ("_" " ")
  ("=" "༴")
  ;; Head marks
  ("@" "༄")
  ("#" "༅")
  ("$" "༆")
  ("%" "༇")
  ;; Paired punctuation marks (brackets)
  ("<" "༺")
  (">" "༻")
  ("(" "༼")
  (")" "༽")
  ;; Miscellaneous
  ("~X" "༵")
  ("X" "༷")
  ("^" "༹"))
 
 (escape
  ("\\" (mark BEG) "\\"))

 (non-tibetan
  ("["))

 (unicode
  ("u" "u" (set MAX-COUNT 4))
  ("U" "U" (set MAX-COUNT 8)))

 (unescape
  ("]"))
  
 (hexadigit
  ("0" "0")
  ("1" "1")
  ("2" "2")
  ("3" "3")
  ("4" "4")
  ("5" "5")
  ("6" "6")
  ("7" "7")
  ("8" "8")
  ("9" "9")
  ("A" "A") ("a" "A")
  ("B" "B") ("b" "B")
  ("C" "C") ("c" "C")
  ("D" "D") ("d" "D")
  ("E" "E") ("e" "E")
  ("F" "F") ("f" "F"))

 (backspace
  ((Backspace) (undo))))

(state
 (init
  (consonant (shift after-consonant))
  (standard-stack (shift after-consonant))
  (vowel (move @<) "ཨ" (move @>) (shift after-vowel))
  (others)
  (escape (shift dispatch-escape))
  (non-tibetan (shift non-tibetan))
  (backspace))

 (after-consonant
  (force-stack (shift consonant-stack))
  (break-stack (shift init))
  (vowel (shift after-vowel)))
  
 (consonant-stack
  (special-subjoined (shift after-consonant))
  (consonant (set C @-1) (delete @-1) (add C #x50) (insert C)
	     (shift after-consonant))
  (force-stack)
  (nil (pop)))

 (after-vowel
  (force-stack (shift vowel-stack)))

 (vowel-stack
  (vowel (shift after-vowel)))

 (dispatch-escape
  (unicode (shift unicode))
  (nil (delete BEG) (shift init) (unhandle)))

 (unicode
  (t (set COUNT 0) (set UNICODE 0))
  (hexadigit (cond ((> @-1 ?9) (set UNICODE (+ (* UNICODE 16) (- @-1 55))))
		   (1 (set UNICODE (+ (* UNICODE 16) (- @-1 48)))))
	     (set COUNT (+ COUNT 1))
	     (cond ((= COUNT MAX-COUNT) (delete BEG) (insert UNICODE)
		    (shift init)))))

 (non-tibetan
  (unescape (shift init))
  (nil (unhandle))))

;; Local Variables:
;; mode: lisp
;; End: