diff options
| author | Kenichi Handa | 1999-12-15 00:50:58 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1999-12-15 00:50:58 +0000 |
| commit | d169c89e684dae9ca76a4381d29957ee4997485d (patch) | |
| tree | f058729342718834de46fd20cc92c9930bcb220a | |
| parent | 3bdf8898b00a8b3fc0b3a275856b0ae28d130cc0 (diff) | |
| download | emacs-d169c89e684dae9ca76a4381d29957ee4997485d.tar.gz emacs-d169c89e684dae9ca76a4381d29957ee4997485d.zip | |
Register tibetan-composition-function in
composition-function-table.
(tibetan-composable-pattern): New variable.
(tibetan-subjoined-transcription-alist): Change key "R" to "+R".
(tibetan-precomposition-rule-alist): Move punctuations to
tibetan-punctuation-transcription-alist and
tibetan-obsolete-glyphs.
(tibetan-punctuation-transcription-alist): New variable.
(tibetan-obsolete-glyphs): New variable.
(tibetan-regexp): Improve the initialization code.
| -rw-r--r-- | lisp/language/tibetan.el | 177 |
1 files changed, 98 insertions, 79 deletions
diff --git a/lisp/language/tibetan.el b/lisp/language/tibetan.el index 7f028a0a303..23ba2985d11 100644 --- a/lisp/language/tibetan.el +++ b/lisp/language/tibetan.el | |||
| @@ -107,9 +107,19 @@ | |||
| 107 | (features tibet-util) | 107 | (features tibet-util) |
| 108 | (documentation . t) | 108 | (documentation . t) |
| 109 | (sample-text . | 109 | (sample-text . |
| 110 | "Tibetan (2$(7"70"](B1$(7"2$(8!;(B2$(7%P`"Q(B1$(7"2$(8!;(B) 2$(7#RP#SP#S(B1$(7!>"7(B2$(7$P`"Q(B1$(8!;(B2$(7"E0"S(B1$(7"G$(8!;$(7"7(B2$(7"20"[(B1$(8!;(B2$(7"D0"[(B1$(7"#"G!>(B2$(7"I0"]0"_(B1$(8!;(B2$(7"9`"Q(B1$(8!;(B2$(7"/0"S(B1$(8!;(B2$(7"5`"Q(B12$(7#2`#90"[(B1$(8!;(B2$(7"H`#A`"U0"c(B1$(7!>(B"))) | 110 | "Tibetan (4$(7"7r'"]0"7"]1"2$(8!;4$(7%Px!"Q0%P"Q1"2$(8!;(B) 4$(7#Rv##Sv##S0#R#S#S1!>"74$Px!"Q0$P"Q1$(8!;4$(7"Er'"S0"E"S1"G$(8!;$(7"74"2r'"[0"2"[1$(8!;4$(7"Dr'"[0"D"[1"#"G!>4"Ir'"]r'"_0"I"]"_1$(8!;4$(7"9x!"Q0"9"Q1$(8!;4$(7"/r'"S0"/"S1$(8!;4$(7"5x!"Q0"5"Q14#2x!#9r'"[0#2#9"[1$(8!;4$(7"Hx!#Ax!"Ur'"c0"H#A"U"c1!>(B"))) |
| 111 | 111 | ||
| 112 | 112 | ||
| 113 | ;; `$(7"A(B' is included in the pattern for subjoined consonants because we | ||
| 114 | ;; treat it specially in tibetan-add-components. | ||
| 115 | (defconst tibetan-composable-pattern | ||
| 116 | "[$(7"!(B-$(7"J(B][$(7"A#!(B-$(7#J(B]*[$(7"Q(B-$(7"^"a"e(B]?[$(7"_"c"d"g(B-$(7"l!I!e!g(B]?" | ||
| 117 | "Regexp matching a composable sequence of Tibetan characters.") | ||
| 118 | |||
| 119 | ;; Register a function to compose Tibetan characters. | ||
| 120 | (aset composition-function-table (make-char 'tibetan) | ||
| 121 | (list (cons tibetan-composable-pattern 'tibetan-composition-function))) | ||
| 122 | |||
| 113 | ;;; | 123 | ;;; |
| 114 | ;;; Definitions of conversion data. | 124 | ;;; Definitions of conversion data. |
| 115 | ;;; | 125 | ;;; |
| @@ -175,21 +185,23 @@ | |||
| 175 | ("E" . "$(7"\(B") | 185 | ("E" . "$(7"\(B") |
| 176 | ("O" . "$(7"^(B") | 186 | ("O" . "$(7"^(B") |
| 177 | ("I" . "$(7"a(B") | 187 | ("I" . "$(7"a(B") |
| 178 | ("M" . "$(7"_(B") | ||
| 179 | ("~" . "$(7"c(B") ; not specified in Ext.wylie | ||
| 180 | ("`" . "$(7"d(B") ; idem. | ||
| 181 | ("," . "$(7"e(B") ; idem. | 188 | ("," . "$(7"e(B") ; idem. |
| 182 | ("v" . "$(7"g(B") ; idem. | ||
| 183 | ("V" . "$(7"h(B") ; idem. | ||
| 184 | ("x" . "$(7"i(B") ; idem. | ||
| 185 | ("X" . "$(7"j(B") ; idem. | ||
| 186 | ("q" . "$(7"k(B") ; idem. | ||
| 187 | ("Q" . "$(7"l(B") ; idem. | ||
| 188 | ("_o" . "$(7!g(B") ; idem. | ||
| 189 | ("_O" . "$(7!e(B") ; idem. | ||
| 190 | ("_/" . "$(7!I(B") ; idem. | ||
| 191 | )) | 189 | )) |
| 192 | 190 | ||
| 191 | (defconst tibetan-modifier-transcription-alist | ||
| 192 | '(("M" . "$(7"_(B") | ||
| 193 | ("~" . "$(7"c(B") | ||
| 194 | ("`" . "$(7"d(B") | ||
| 195 | ("x" . "$(7"i(B") | ||
| 196 | ("X" . "$(7"j(B") | ||
| 197 | ("v" . "$(7"g(B") | ||
| 198 | ("V" . "$(7"h(B") | ||
| 199 | ("q" . "$(7"k(B") | ||
| 200 | ("Q" . "$(7"l(B") | ||
| 201 | ("_/" . "$(7!I(B") | ||
| 202 | ("_o" . "$(7!g(B") | ||
| 203 | ("_O" . "$(7!e(B"))) | ||
| 204 | |||
| 193 | (defconst tibetan-precomposed-transcription-alist | 205 | (defconst tibetan-precomposed-transcription-alist |
| 194 | '(("phyw" . "$(7$G(B") | 206 | '(("phyw" . "$(7$G(B") |
| 195 | ("tshw" . "$(7$)(B") | 207 | ("tshw" . "$(7$)(B") |
| @@ -302,48 +314,49 @@ | |||
| 302 | ("sm" . "$(7%Y(B"))) | 314 | ("sm" . "$(7%Y(B"))) |
| 303 | 315 | ||
| 304 | (defconst tibetan-subjoined-transcription-alist | 316 | (defconst tibetan-subjoined-transcription-alist |
| 305 | '(("+k" . "$(7#!(B") | 317 | (sort '(("+k" . "$(7#!(B") |
| 306 | ("+kh" . "$(7#"(B") | 318 | ("+kh" . "$(7#"(B") |
| 307 | ("+g" . "$(7##(B") | 319 | ("+g" . "$(7##(B") |
| 308 | ("+gh" . "$(7#$(B") | 320 | ("+gh" . "$(7#$(B") |
| 309 | ("+ng" . "$(7#%(B") | 321 | ("+ng" . "$(7#%(B") |
| 310 | ("+c" . "$(7#&(B") | 322 | ("+c" . "$(7#&(B") |
| 311 | ("+ch" . "$(7#'(B") | 323 | ("+ch" . "$(7#'(B") |
| 312 | ("+j" . "$(7#((B") | 324 | ("+j" . "$(7#((B") |
| 313 | ("+ny" . "$(7#*(B") | 325 | ("+ny" . "$(7#*(B") |
| 314 | ("+T" . "$(7#+(B") | 326 | ("+T" . "$(7#+(B") |
| 315 | ("+TH" . "$(7#,(B") | 327 | ("+TH" . "$(7#,(B") |
| 316 | ("+D" . "$(7#-(B") | 328 | ("+D" . "$(7#-(B") |
| 317 | ("+DH" . "$(7#.(B") | 329 | ("+DH" . "$(7#.(B") |
| 318 | ("+N" . "$(7#/(B") | 330 | ("+N" . "$(7#/(B") |
| 319 | ("+t" . "$(7#0(B") | 331 | ("+t" . "$(7#0(B") |
| 320 | ("+th" . "$(7#1(B") | 332 | ("+th" . "$(7#1(B") |
| 321 | ("+d" . "$(7#2(B") | 333 | ("+d" . "$(7#2(B") |
| 322 | ("+dh" . "$(7#3(B") | 334 | ("+dh" . "$(7#3(B") |
| 323 | ("+n" . "$(7#4(B") | 335 | ("+n" . "$(7#4(B") |
| 324 | ("+p" . "$(7#5(B") | 336 | ("+p" . "$(7#5(B") |
| 325 | ("+ph" . "$(7#6(B") | 337 | ("+ph" . "$(7#6(B") |
| 326 | ("+b" . "$(7#7(B") | 338 | ("+b" . "$(7#7(B") |
| 327 | ("+bh" . "$(7#8(B") | 339 | ("+bh" . "$(7#8(B") |
| 328 | ("+m" . "$(7#9(B") | 340 | ("+m" . "$(7#9(B") |
| 329 | ("+ts" . "$(7#:(B") | 341 | ("+ts" . "$(7#:(B") |
| 330 | ("+tsh" . "$(7#;(B") | 342 | ("+tsh" . "$(7#;(B") |
| 331 | ("+dz" . "$(7#<(B") | 343 | ("+dz" . "$(7#<(B") |
| 332 | ("+dzh" . "$(7#=(B") | 344 | ("+dzh" . "$(7#=(B") |
| 333 | ("+w" . "$(7#>(B") | 345 | ("+w" . "$(7#>(B") |
| 334 | ("+zh" . "$(7#?(B") | 346 | ("+zh" . "$(7#?(B") |
| 335 | ("+z" . "$(7#@(B") | 347 | ("+z" . "$(7#@(B") |
| 336 | ("+'" . "$(7#A(B") | 348 | ("+'" . "$(7#A(B") |
| 337 | ("+y" . "$(7#B(B") | 349 | ("+y" . "$(7#B(B") |
| 338 | ("+r" . "$(7#C(B") | 350 | ("+r" . "$(7#C(B") |
| 339 | ("+l" . "$(7#D(B") | 351 | ("+l" . "$(7#D(B") |
| 340 | ("+sh" . "$(7#E(B") | 352 | ("+sh" . "$(7#E(B") |
| 341 | ("+SH" . "$(7#F(B") | 353 | ("+SH" . "$(7#F(B") |
| 342 | ("+s" . "$(7#G(B") | 354 | ("+s" . "$(7#G(B") |
| 343 | ("+h" . "$(7#H(B") | 355 | ("+h" . "$(7#H(B") |
| 344 | ("+A" . "$(7#I(B") | 356 | ("+A" . "$(7#I(B") |
| 345 | ("+kSH" . "$(7#J(B") | 357 | ("+kSH" . "$(7#J(B") |
| 346 | ("R" . "$(7#P(B"))) | 358 | ("+R" . "$(7#P(B")) |
| 359 | (lambda (x y) (> (length (car x)) (length (car y)))))) | ||
| 347 | 360 | ||
| 348 | ;;; | 361 | ;;; |
| 349 | ;;; alist for Tibetan base consonant <-> subjoined consonant conversion. | 362 | ;;; alist for Tibetan base consonant <-> subjoined consonant conversion. |
| @@ -396,7 +409,7 @@ | |||
| 396 | ;;; (includes some punctuation conversion rules) | 409 | ;;; (includes some punctuation conversion rules) |
| 397 | ;;; | 410 | ;;; |
| 398 | (defconst tibetan-precomposition-rule-alist | 411 | (defconst tibetan-precomposition-rule-alist |
| 399 | '(("$(7"6#B#>(B" . "$(7$G(B") | 412 | `(("$(7"6#B#>(B" . "$(7$G(B") |
| 400 | ("$(7"##C#>(B" . "$(7$_(B") | 413 | ("$(7"##C#>(B" . "$(7$_(B") |
| 401 | ("$(7";#>(B" . "$(7$)(B") | 414 | ("$(7";#>(B" . "$(7$)(B") |
| 402 | ("$(7"C#:#>(B" . "$(7%.(B") | 415 | ("$(7"C#:#>(B" . "$(7%.(B") |
| @@ -490,36 +503,42 @@ | |||
| 490 | ("$(7"G#4(B" . "$(7%V(B") | 503 | ("$(7"G#4(B" . "$(7%V(B") |
| 491 | ("$(7"G#5(B" . "$(7%W(B") | 504 | ("$(7"G#5(B" . "$(7%W(B") |
| 492 | ("$(7"G#7(B" . "$(7%X(B") | 505 | ("$(7"G#7(B" . "$(7%X(B") |
| 493 | ("$(7"G#9(B" . "$(7%Y(B") | 506 | ("$(7"G#9(B" . "$(7%Y(B"))) |
| 494 | ("$(7!=(B" . "$(8!=(B") ; 2 col <-> 1 col | 507 | |
| 508 | (defconst tibetan-obsolete-glyphs | ||
| 509 | `(("$(7!=(B" . "$(8!=(B") ; 2 col <-> 1 col | ||
| 495 | ("$(7!?(B" . "$(8!?(B") | 510 | ("$(7!?(B" . "$(8!?(B") |
| 496 | ("$(7!@(B" . "$(8!@(B") | 511 | ("$(7!@(B" . "$(8!@(B") |
| 497 | ("$(7!A(B" . "$(8!A(B") | 512 | ("$(7!A(B" . "$(8!A(B") |
| 498 | ("$(7"`(B" . "$(8"`(B") | 513 | ("$(7"`(B" . "$(8"`(B") |
| 499 | ("$(7!;(B" . "$(8!;(B") | 514 | ("$(7!;(B" . "$(8!;(B") |
| 500 | ("$(7!D(B" . "$(8!D(B") | 515 | ("$(7!D(B" . "$(8!D(B") |
| 501 | ("$(7!>(B $(7!>(B" . "2$(7!>P(B P$(7!>(B1") ; Yes this is dirty. But ... | 516 | ;; Yes these are dirty. But ... |
| 502 | ("$(7!4!5!5(B" . "2$(7#RP#SP#SP#S(B1") | 517 | ("$(7!>(B $(7!>(B" . ,(compose-string "$(7!>(B $(7!>(B" 0 3 [?$(7!>(B (Br . Bl) ? (Br . Bl) ?$(7!>(B])) |
| 503 | ("$(7!4!5(B" . "2$(7#RP#SP#S(B1") | 518 | ("$(7!4!5!5(B" . ,(compose-string |
| 504 | ("$(7!6(B" . "2$(7#RP#S_!I(B1") | 519 | "$(7#R#S#S#S(B" 0 4 |
| 505 | ("$(7!4(B" . "2$(7#RP#S(B1"))) | 520 | [?$(7#R(B (Br . Bl) ?$(7#S(B (Br . Bl) ?$(7#S(B (Br . Bl) ?$(7#S(B])) |
| 506 | 521 | ("$(7!4!5(B" . ,(compose-string "$(7#R#S#S(B" 0 3 [?$(7#R(B (Br . Bl) ?$(7#S(B (Br . Bl) ?$(7#S(B])) | |
| 507 | (defvar tibetan-regexp | 522 | ("$(7!6(B" . ,(compose-string "$(7#R#S!I(B" 0 3 [?$(7#R(B (Br . Bl) ?$(7#S(B (br . tr) ?$(7!I(B])) |
| 508 | (let ((l (append tibetan-consonant-transcription-alist | 523 | ("$(7!4(B" . ,(compose-string "$(7#R#S(B" 0 2 [?$(7#R(B (Br . Bl) ?$(7#S(B])))) |
| 509 | tibetan-vowel-transcription-alist | 524 | |
| 510 | tibetan-subjoined-transcription-alist)) | 525 | (defconst tibetan-regexp |
| 511 | temp) | 526 | (let ((l (list tibetan-precomposed-transcription-alist |
| 512 | (setq temp "\\(") | 527 | tibetan-consonant-transcription-alist |
| 513 | (setq temp (concat temp (car (car l)))) | 528 | tibetan-vowel-transcription-alist |
| 514 | (setq l (cdr l)) | 529 | tibetan-modifier-transcription-alist |
| 530 | tibetan-subjoined-transcription-alist)) | ||
| 531 | (separator "\\|") | ||
| 532 | tail pattern) | ||
| 515 | (while l | 533 | (while l |
| 516 | (setq temp (concat temp "\\|" (car (car l)))) | 534 | (setq tail (car l) l (cdr l)) |
| 517 | (setq l (cdr l))) | 535 | (while tail |
| 518 | (concat temp "\\)$")) | 536 | (setq pattern (cons separator (cons (car (car tail)) pattern)) |
| 519 | "Regexp string to match a romanized Tibetan character component, i.e., | 537 | tail (cdr tail)))) |
| 520 | base and subjoined consonant, vowel and vowel modifier. The result of matching | 538 | (apply 'concat (nreverse (cdr pattern)))) |
| 521 | is to be used for indexing alists at conversion from a roman transcription to | 539 | "Regexp matching a Tibetan transcription of a composable Tibetan sequence. |
| 522 | the corresponding Tibetan character.") | 540 | The result of matching is to be used for indexing alists at conversion |
| 541 | from a roman transcription to the corresponding Tibetan character.") | ||
| 523 | 542 | ||
| 524 | (defvar tibetan-precomposed-regexp | 543 | (defvar tibetan-precomposed-regexp |
| 525 | (let ((l tibetan-precomposed-transcription-alist) | 544 | (let ((l tibetan-precomposed-transcription-alist) |