annotate lisp/language/lao-util.el @ 86288:145903731829

* term.c: Include stdarg.h. (fatal): Implement using varargs. * lisp.h (fatal): Add argument types. (Restore 2005-09-30 change).
author Dan Nicolaescu <dann@ics.uci.edu>
date Thu, 22 Nov 2007 01:01:26 +0000
parents 0938de05f510
children b5d3fc1c4afe f55f9811f5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36683
b82a6fbaae16 Add coding: iso-2022-7bit tag.
Kenichi Handa <handa@m17n.org>
parents: 29361
diff changeset
1 ;;; lao-util.el --- utilities for Lao -*- coding: iso-2022-7bit; -*-
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
2
75347
e3694f1cb928 Add 2007 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 74605
diff changeset
3 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
74544
43cc94d955c2 Update copyright years.
Glenn Morris <rgm@gnu.org>
parents: 64085
diff changeset
4 ;; Free Software Foundation, Inc.
75347
e3694f1cb928 Add 2007 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 74605
diff changeset
5 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
62396
197607499a29 Fix copyrights.
Kenichi Handa <handa@m17n.org>
parents: 52401
diff changeset
6 ;; National Institute of Advanced Industrial Science and Technology (AIST)
197607499a29 Fix copyrights.
Kenichi Handa <handa@m17n.org>
parents: 52401
diff changeset
7 ;; Registration Number H14PRO021
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
8
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
9 ;; Keywords: multilingual, Lao
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
10
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
11 ;; This file is part of GNU Emacs.
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
12
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
78309
0938de05f510 Restore comma mistakenly removed in last change.
Glenn Morris <rgm@gnu.org>
parents: 78300
diff changeset
15 ;; the Free Software Foundation; either version 3, or (at your option)
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
16 ;; any later version.
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
17
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
18 ;; GNU Emacs is distributed in the hope that it will be useful,
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
21 ;; GNU General Public License for more details.
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
22
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62396
diff changeset
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62396
diff changeset
26 ;; Boston, MA 02110-1301, USA.
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
27
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36683
diff changeset
28 ;;; Commentary:
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36683
diff changeset
29
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
30 ;;; Code:
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
31
26894
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
32 ;; Setting information of Thai characters.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
33
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
34 (defconst lao-category-table (make-category-table))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
35 (define-category ?c "Lao consonant" lao-category-table)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
36 (define-category ?s "Lao semi-vowel" lao-category-table)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
37 (define-category ?v "Lao upper/lower vowel" lao-category-table)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
38 (define-category ?t "Lao tone" lao-category-table)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
39
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
40 (let ((l '((?(1!(B consonant "LETTER KOR KAI'" "CHICKEN")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
41 (?(1"(B consonant "LETTER KHOR KHAI'" "EGG")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
42 (?(1#(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
43 (?(1$(B consonant "LETTER QHOR QHWARGN" "BUFFALO")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
44 (?(1%(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
45 (? invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
46 (?(1'(B consonant "LETTER NGOR NGUU" "SNAKE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
47 (?(1((B consonant "LETTER JOR JUA" "BUDDHIST NOVICE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
48 (?(1)(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
49 (?(1*(B consonant "LETTER XOR X\"ARNG" "ELEPHANT")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
50 (?(1+(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
51 (?(1,(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
52 (?(1-(B consonant "LETTER YOR YUNG" "MOSQUITO")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
53 (?(1.(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
54 (?(1.(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
55 (?(1.(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
56 (?(1.(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
57 (?(1.(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
58 (?(1.(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
59 (?(14(B consonant "LETTER DOR DANG" "NOSE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
60 (?(15(B consonant "LETTER TOR TAR" "EYE")
19271
0caaca9020bc Set t for Rao-SEMIVOWEL-SIGN-LO in
Kenichi Handa <handa@m17n.org>
parents: 18550
diff changeset
61 (?(16(B consonant "LETTER THOR THUNG" "TO ASK,QUESTION")
0caaca9020bc Set t for Rao-SEMIVOWEL-SIGN-LO in
Kenichi Handa <handa@m17n.org>
parents: 18550
diff changeset
62 (?(17(B consonant "LETTER DHOR DHARM" "FLAG")
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
63 (?(18(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
64 (?(19(B consonant "LETTER NOR NOK" "BIRD")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
65 (?(1:(B consonant "LETTER BOR BED" "FISHHOOK")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
66 (?(1;(B consonant "LETTER POR PAR" "FISH")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
67 (?(1<(B consonant "LETTER HPOR HPER\"" "BEE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
68 (?(1=(B consonant "LETTER FHOR FHAR" "WALL")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
69 (?(1>(B consonant "LETTER PHOR PHUU" "MOUNTAIN")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
70 (?(1?(B consonant "LETTER FOR FAI" "FIRE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
71 (?(1@(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
72 (?(1A(B consonant "LETTER MOR MAR\"" "HORSE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
73 (?(1B(B consonant "LETTER GNOR GNAR" "MEDICINE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
74 (?(1C(B consonant "LETTER ROR ROD" "CAR")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
75 (?(1D(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
76 (?(1E(B consonant "LETTER LOR LIING" "MONKEY")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
77 (?(1F(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
78 (?(1G(B consonant "LETTER WOR WII" "HAND FAN")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
79 (?(1H(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
80 (?(1I(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
81 (?(1J(B consonant "LETTER SOR SEA" "TIGER")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
82 (?(1K(B consonant "LETTER HHOR HHAI" "JAR")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
83 (?(1L(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
84 (?(1M(B consonant "LETTER OR OOW" "TAKE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
85 (?(1N(B consonant "LETTER HOR HEA" "BOAT")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
86 (?(1O(B special "ELLIPSIS")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
87 (?(1P(B vowel-base "VOWEL SIGN SARA A")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
88 (?(1Q(B vowel-upper "VOWEL SIGN MAI KAN")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
89 (?(1R(B vowel-base "VOWEL SIGN SARA AR")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
90 (?(1S(B vowel-base "VOWEL SIGN SARA AM")
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48042
diff changeset
91 (?(1T(B vowel-upper "VOWEL SIGN SARA I")
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
92 (?(1U(B vowel-upper "VOWEL SIGN SARA II")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
93 (?(1V(B vowel-upper "VOWEL SIGN SARA EU")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
94 (?(1W(B vowel-upper "VOWEL SIGN SARA UR")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
95 (?(1X(B vowel-lower "VOWEL SIGN SARA U")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
96 (?(1Y(B vowel-lower "VOWEL SIGN SARA UU")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
97 (?(1Z(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
98 (?(1[(B vowel-upper "VOWEL SIGN MAI KONG")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
99 (?(1\(B semivowel-lower "SEMIVOWEL SIGN LO")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
100 (?(1](B vowel-base "SEMIVOWEL SIGN SARA IA")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
101 (?(1^(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
102 (?(1_(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
103 (?(1`(B vowel-base "VOWEL SIGN SARA EE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
104 (?(1a(B vowel-base "VOWEL SIGN SARA AA")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
105 (?(1b(B vowel-base "VOWEL SIGN SARA OO")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
106 (?(1c(B vowel-base "VOWEL SIGN SARA EI MAI MUAN\"")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
107 (?(1d(B vowel-base "VOWEL SIGN SARA AI MAI MAY")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
108 (?(1e(B invalid nil)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48042
diff changeset
109 (?(1f(B special "KO LA (REPETITION)")
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
110 (?(1g(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
111 (?(1h(B tone "TONE MAI EK")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
112 (?(1i(B tone "TONE MAI THO")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
113 (?(1j(B tone "TONE MAI TI")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
114 (?(1k(B tone "TONE MAI JADTAWAR")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
115 (?(1l(B tone "CANCELLATION MARK")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
116 (?(1m(B vowel-upper "VOWEL SIGN SARA OR")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
117 (?(1n(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
118 (?(1o(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
119 (?(1p(B special "DIGIT ZERO")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
120 (?(1q(B special "DIGIT ONE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
121 (?(1r(B special "DIGIT TWO")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
122 (?(1s(B special "DIGIT THREE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
123 (?(1t(B special "DIGIT FOUR")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
124 (?(1u(B special "DIGIT FIVE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
125 (?(1v(B special "DIGIT SIX")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
126 (?(1w(B special "DIGIT SEVEN")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
127 (?(1x(B special "DIGIT EIGHT")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
128 (?(1y(B special "DIGIT NINE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
129 (?(1z(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
130 (?(1{(B invalid nil)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
131 (?(1|(B consonant "LETTER NHOR NHUU" "MOUSE")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
132 (?(1}(B consonant "LETTER MHOR MHAR" "DOG")
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
133 (?(1~(B invalid nil)
41890
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
134 ;; Unicode equivalents
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
135 (?$,1D!(B consonant "LETTER KOR KAI'" "CHICKEN")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
136 (?$,1D"(B consonant "LETTER KHOR KHAI'" "EGG")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
137 (?$,1D$(B consonant "LETTER QHOR QHWARGN" "BUFFALO")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
138 (?$,1D'(B consonant "LETTER NGOR NGUU" "SNAKE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
139 (?$,1D((B consonant "LETTER JOR JUA" "BUDDHIST NOVICE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
140 (?$,1D*(B consonant "LETTER XOR X\"ARNG" "ELEPHANT")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
141 (?$,1D-(B consonant "LETTER YOR YUNG" "MOSQUITO")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
142 (?$,1D4(B consonant "LETTER DOR DANG" "NOSE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
143 (?$,1D5(B consonant "LETTER TOR TAR" "EYE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
144 (?$,1D6(B consonant "LETTER THOR THUNG" "TO ASK,QUESTION")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
145 (?$,1D7(B consonant "LETTER DHOR DHARM" "FLAG")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
146 (?$,1D9(B consonant "LETTER NOR NOK" "BIRD")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
147 (?$,1D:(B consonant "LETTER BOR BED" "FISHHOOK")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
148 (?$,1D;(B consonant "LETTER POR PAR" "FISH")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
149 (?$,1D<(B consonant "LETTER HPOR HPER\"" "BEE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
150 (?$,1D=(B consonant "LETTER FHOR FHAR" "WALL")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
151 (?$,1D>(B consonant "LETTER PHOR PHUU" "MOUNTAIN")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
152 (?$,1D?(B consonant "LETTER FOR FAI" "FIRE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
153 (?$,1DA(B consonant "LETTER MOR MAR\"" "HORSE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
154 (?$,1DB(B consonant "LETTER GNOR GNAR" "MEDICINE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
155 (?$,1DC(B consonant "LETTER ROR ROD" "CAR")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
156 (?$,1DE(B consonant "LETTER LOR LIING" "MONKEY")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
157 (?$,1DG(B consonant "LETTER WOR WII" "HAND FAN")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
158 (?$,1DJ(B consonant "LETTER SOR SEA" "TIGER")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
159 (?$,1DK(B consonant "LETTER HHOR HHAI" "JAR")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
160 (?$,1DM(B consonant "LETTER OR OOW" "TAKE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
161 (?$,1DN(B consonant "LETTER HOR HEA" "BOAT")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
162 (?$,1DO(B special "ELLIPSIS")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
163 (?$,1DP(B vowel-base "VOWEL SIGN SARA A")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
164 (?$,1DQ(B vowel-upper "VOWEL SIGN MAI KAN")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
165 (?$,1DR(B vowel-base "VOWEL SIGN SARA AR")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
166 (?$,1DS(B vowel-base "VOWEL SIGN SARA AM")
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48042
diff changeset
167 (?$,1DT(B vowel-upper "VOWEL SIGN SARA I")
41890
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
168 (?$,1DU(B vowel-upper "VOWEL SIGN SARA II")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
169 (?$,1DV(B vowel-upper "VOWEL SIGN SARA EU")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
170 (?$,1DW(B vowel-upper "VOWEL SIGN SARA UR")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
171 (?$,1DX(B vowel-lower "VOWEL SIGN SARA U")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
172 (?$,1DY(B vowel-lower "VOWEL SIGN SARA UU")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
173 (?$,1D[(B vowel-upper "VOWEL SIGN MAI KONG")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
174 (?$,1D\(B semivowel-lower "SEMIVOWEL SIGN LO")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
175 (?$,1D](B vowel-base "SEMIVOWEL SIGN SARA IA")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
176 (?$,1D`(B vowel-base "VOWEL SIGN SARA EE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
177 (?$,1Da(B vowel-base "VOWEL SIGN SARA AA")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
178 (?$,1Db(B vowel-base "VOWEL SIGN SARA OO")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
179 (?$,1Dc(B vowel-base "VOWEL SIGN SARA EI MAI MUAN\"")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
180 (?$,1Dd(B vowel-base "VOWEL SIGN SARA AI MAI MAY")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
181 (?$,1Df(B special "KO LA (REPETITION)")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
182 (?$,1Dh(B tone "TONE MAI EK")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
183 (?$,1Di(B tone "TONE MAI THO")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
184 (?$,1Dj(B tone "TONE MAI TI")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
185 (?$,1Dk(B tone "TONE MAI JADTAWAR")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
186 (?$,1Dl(B tone "CANCELLATION MARK")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
187 (?$,1Dm(B vowel-upper "VOWEL SIGN SARA OR")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
188 (?$,1Dp(B special "DIGIT ZERO")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
189 (?$,1Dq(B special "DIGIT ONE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
190 (?$,1Dr(B special "DIGIT TWO")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
191 (?$,1Ds(B special "DIGIT THREE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
192 (?$,1Dt(B special "DIGIT FOUR")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
193 (?$,1Du(B special "DIGIT FIVE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
194 (?$,1Dv(B special "DIGIT SIX")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
195 (?$,1Dw(B special "DIGIT SEVEN")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
196 (?$,1Dx(B special "DIGIT EIGHT")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
197 (?$,1Dy(B special "DIGIT NINE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
198 (?$,1D|(B consonant "LETTER NHOR NHUU" "MOUSE")
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
199 (?$,1D}(B consonant "LETTER MHOR MHAR" "DOG")))
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
200 elm)
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
201 (while l
26894
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
202 (setq elm (car l) l (cdr l))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
203 (let ((char (car elm))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
204 (ptype (nth 1 elm)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
205 (cond ((eq ptype 'consonant)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
206 (modify-category-entry char ?c lao-category-table))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
207 ((memq ptype '(vowel-upper vowel-lower))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
208 (modify-category-entry char ?v lao-category-table))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
209 ((eq ptype 'semivowel-lower)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
210 (modify-category-entry char ?s lao-category-table))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
211 ((eq ptype 'tone)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
212 (modify-category-entry char ?t lao-category-table)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
213 (put-char-code-property char 'phonetic-type ptype)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
214 (put-char-code-property char 'name (nth 2 elm))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
215 (put-char-code-property char 'meaning (nth 3 elm)))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
216
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
217 ;; The general composing rules are as follows:
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
218 ;;
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
219 ;; T
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
220 ;; V T V T
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
221 ;; CV -> C, CT -> C, CVT -> C, Cv -> C, CvT -> C
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
222 ;; v v
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
223 ;; T
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
224 ;; V T V T
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
225 ;; CsV -> C, CsT -> C, CsVT -> C, Csv -> C, CvT -> C
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
226 ;; s s s s s
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
227 ;; v v
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
228
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
229
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
230 ;; where C: consonant, V: vowel upper, v: vowel lower,
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
231 ;; T: tone mark, s: semivowel lower
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
232
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
233 (defvar lao-composition-pattern
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
234 "\\cc\\(\\ct\\|\\cv\\ct?\\|\\cs\\(\\ct\\|\\cv\\ct?\\)?\\)"
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
235 "Regular expression matching a Lao composite sequence.")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
236
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
237 ;;;###autoload
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
238 (defun lao-compose-string (str)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
239 (with-category-table lao-category-table
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
240 (let ((idx 0))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
241 (while (setq idx (string-match lao-composition-pattern str idx))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
242 (compose-string str idx (match-end 0))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
243 (setq idx (match-end 0))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
244 str))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
245
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
246 ;;; LRT: Lao <-> Roman Transcription
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
247
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
248 ;; Upper vowels and tone-marks are put on the letter.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
249 ;; Semi-vowel-sign-lo and lower vowels are put under the letter.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
250
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
251 (defconst lao-transcription-consonant-alist
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
252 (sort '(;; single consonants
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
253 ("k" . "(1!(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
254 ("kh" . "(1"(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
255 ("qh" . "(1$(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
256 ("ng" . "(1'(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
257 ("j" . "(1((B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
258 ("s" . "(1J(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
259 ("x" . "(1*(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
260 ("y" . "(1-(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
261 ("d" . "(14(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
262 ("t" . "(15(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
263 ("th" . "(16(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
264 ("dh" . "(17(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
265 ("n" . "(19(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
266 ("b" . "(1:(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
267 ("p" . "(1;(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
268 ("hp" . "(1<(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
269 ("fh" . "(1=(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
270 ("ph" . "(1>(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
271 ("f" . "(1?(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
272 ("m" . "(1A(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
273 ("gn" . "(1B(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
274 ("l" . "(1E(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
275 ("r" . "(1C(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
276 ("v" . "(1G(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
277 ("w" . "(1G(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
278 ("hh" . "(1K(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
279 ("O" . "(1M(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
280 ("h" . "(1N(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
281 ("nh" . "(1|(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
282 ("mh" . "(1}(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
283 ("lh" . ["(1K\(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
284 ;; double consonants
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
285 ("ngh" . ["(1K'(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
286 ("yh" . ["(1K](B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
287 ("wh" . ["(1KG(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
288 ("hl" . ["(1KE(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
289 ("hy" . ["(1K-(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
290 ("hn" . ["(1K9(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
291 ("hm" . ["(1KA(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
292 )
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
293 (function (lambda (x y) (> (length (car x)) (length (car y)))))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
294
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
295 (defconst lao-transcription-semi-vowel-alist
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
296 '(("r" . "(1\(B")))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
297
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
298 (defconst lao-transcription-vowel-alist
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
299 (sort '(("a" . "(1P(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
300 ("ar" . "(1R(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
301 ("i" . "(1T(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
302 ("ii" . "(1U(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
303 ("eu" . "(1V(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
304 ("ur" . "(1W(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
305 ("u" . "(1X(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
306 ("uu" . "(1Y(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
307 ("e" . ["(1`P(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
308 ("ee" . "(1`(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
309 ("ae" . ["(1aP(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
310 ("aa" . "(1a(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
311 ("o" . ["(1bP(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
312 ("oo" . "(1b(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
313 ("oe" . ["(1`RP(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
314 ("or" . "(1m(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
315 ("er" . ["(1`T(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
316 ("ir" . ["(1`U(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
317 ("ua" . ["(1[GP(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
318 ("uaa" . ["(1[G(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
319 ("ie" . ["(1`Q]P(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
320 ("ia" . ["(1`Q](B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
321 ("ea" . ["(1`VM(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
322 ("eaa" . ["(1`WM(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
323 ("ai" . "(1d(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
324 ("ei" . "(1c(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
325 ("ao" . ["(1`[R(B"])
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
326 ("aM" . "(1S(B"))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
327 (function (lambda (x y) (> (length (car x)) (length (car y)))))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
328
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
329 ;; Maa-sakod is put at the tail.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
330 (defconst lao-transcription-maa-sakod-alist
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
331 '(("k" . "(1!(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
332 ("g" . "(1'(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
333 ("y" . "(1-(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
334 ("d" . "(14(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
335 ("n" . "(19(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
336 ("b" . "(1:(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
337 ("m" . "(1A(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
338 ("v" . "(1G(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
339 ("w" . "(1G(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
340 ))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
341
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
342 (defconst lao-transcription-tone-alist
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
343 '(("'" . "(1h(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
344 ("\"" . "(1i(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
345 ("^" . "(1j(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
346 ("+" . "(1k(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
347 ("~" . "(1l(B")))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
348
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
349 (defconst lao-transcription-punctuation-alist
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
350 '(("\\0" . "(1p(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
351 ("\\1" . "(1q(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
352 ("\\2" . "(1r(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
353 ("\\3" . "(1s(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
354 ("\\4" . "(1t(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
355 ("\\5" . "(1u(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
356 ("\\6" . "(1v(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
357 ("\\7" . "(1w(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
358 ("\\8" . "(1x(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
359 ("\\9" . "(1y(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
360 ("\\\\" . "(1f(B")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
361 ("\\$" . "(1O(B")))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
362
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
363 (defconst lao-transcription-pattern
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
364 (concat
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
365 "\\("
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
366 (mapconcat 'car lao-transcription-consonant-alist "\\|")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
367 "\\)\\("
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
368 (mapconcat 'car lao-transcription-semi-vowel-alist "\\|")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
369 "\\)?\\(\\("
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
370 (mapconcat 'car lao-transcription-vowel-alist "\\|")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
371 "\\)\\("
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
372 (mapconcat 'car lao-transcription-maa-sakod-alist "\\|")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
373 "\\)?\\("
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
374 (mapconcat (lambda (x) (regexp-quote (car x)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
375 lao-transcription-tone-alist "\\|")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
376 "\\)?\\)?\\|"
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
377 (mapconcat (lambda (x) (regexp-quote (car x)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
378 lao-transcription-punctuation-alist "\\|")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
379 )
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
380 "Regexp of Roman transcription pattern for one Lao syllable.")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
381
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
382 (defconst lao-transcription-pattern
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
383 (concat
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
384 "\\("
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
385 (regexp-opt (mapcar 'car lao-transcription-consonant-alist))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
386 "\\)\\("
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
387 (regexp-opt (mapcar 'car lao-transcription-semi-vowel-alist))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
388 "\\)?\\(\\("
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
389 (regexp-opt (mapcar 'car lao-transcription-vowel-alist))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
390 "\\)\\("
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
391 (regexp-opt (mapcar 'car lao-transcription-maa-sakod-alist))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
392 "\\)?\\("
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
393 (regexp-opt (mapcar 'car lao-transcription-tone-alist))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
394 "\\)?\\)?\\|"
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
395 (regexp-opt (mapcar 'car lao-transcription-punctuation-alist))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
396 )
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
397 "Regexp of Roman transcription pattern for one Lao syllable.")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
398
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
399 (defconst lao-vowel-reordering-rule
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
400 '(("(1P(B" (0 ?(1P(B) (0 ?(1Q(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
401 ("(1R(B" (0 ?(1R(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
402 ("(1T(B" (0 ?(1U(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
403 ("(1U(B" (0 ?(1U(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
404 ("(1V(B" (0 ?(1V(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
405 ("(1W(B" (0 ?(1W(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
406 ("(1X(B" (0 ?(1X(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
407 ("(1Y(B" (0 ?(1Y(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
408 ("(1`P(B" (?(1`(B 0 ?(1P(B) (?(1`(B 0 ?(1Q(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
409 ("(1`(B" (?(1`(B 0))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
410 ("(1aP(B" (?(1a(B 0 ?(1P(B) (?(1a(B 0 ?(1Q(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
411 ("(1a(B" (?(1a(B 0))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
412 ("(1bP(B" (?(1b(B 0 ?(1P(B) (0 ?(1[(B) (?(1-(B ?(1b(B 0 ?(1Q(B) (?(1G(B ?(1b(B 0 ?(1Q(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
413 ("(1b(B" (?(1b(B 0))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
414 ("(1`RP(B" (?(1`(B 0 ?(1R(B ?(1P(B) (0 ?(1Q(B ?(1M(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
415 ("(1m(B" (0 ?(1m(B) (0 ?(1M(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
416 ("(1`T(B" (?(1`(B 0 ?(1T(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
417 ("(1`U(B" (?(1`(B 0 ?(1U(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
418 ("(1[GP(B" (0 ?(1[(B ?(1G(B ?(1P(B) (0 ?(1Q(B ?(1G(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
419 ("(1[G(B" (0 ?(1[(B ?(1G(B) (0 ?(1G(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
420 ("(1`Q]P(B" (?(1`(B 0 ?(1Q(B ?(1](B ?(1P(B) (0 ?(1Q(B ?(1](B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
421 ("(1`Q](B" (?(1`(B 0 ?(1Q(B ?(1](B) (0 ?(1](B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
422 ("(1`VM(B" (?(1`(B 0 ?(1V(B ?(1M(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
423 ("(1`WM(B" (?(1`(B 0 ?(1W(B ?(1M(B))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
424 ("(1d(B" (?(1d(B 0))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
425 ("(1c(B" (?(1c(B 0))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
426 ("(1`[R(B" (?(1`(B 0 ?(1[(B ?(1R(B))
41890
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
427 ("(1S(B" (0 ?(1S(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
428
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
429 ;; Unicode equivalents
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
430 ("$,1DP(B" (0 ?$,1DP(B) (0 ?$,1DQ(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
431 ("$,1DR(B" (0 ?$,1DR(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
432 ("$,1DT(B" (0 ?$,1DU(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
433 ("$,1DU(B" (0 ?$,1DU(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
434 ("$,1DV(B" (0 ?$,1DV(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
435 ("$,1DW(B" (0 ?$,1DW(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
436 ("$,1DX(B" (0 ?$,1DX(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
437 ("$,1DY(B" (0 ?$,1DY(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
438 ("$,1D`DP(B" (?$,1D`(B 0 ?$,1DP(B) (?$,1D`(B 0 ?$,1DQ(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
439 ("$,1D`(B" (?$,1D`(B 0))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
440 ("$,1DaDP(B" (?$,1Da(B 0 ?$,1DP(B) (?$,1Da(B 0 ?$,1DQ(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
441 ("$,1Da(B" (?$,1Da(B 0))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
442 ("$,1DbDP(B" (?$,1Db(B 0 ?$,1DP(B) (0 ?$,1D[(B) (?$,1D-(B ?$,1Db(B 0 ?$,1DQ(B) (?$,1DG(B ?$,1Db(B 0 ?$,1DQ(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
443 ("$,1Db(B" (?$,1Db(B 0))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
444 ("$,1D`DRDP(B" (?$,1D`(B 0 ?$,1DR(B ?$,1DP(B) (0 ?$,1DQ(B ?$,1DM(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
445 ("$,1Dm(B" (0 ?$,1Dm(B) (0 ?$,1DM(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
446 ("$,1D`DT(B" (?$,1D`(B 0 ?$,1DT(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
447 ("$,1D`DU(B" (?$,1D`(B 0 ?$,1DU(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
448 ("$,1D[DGDP(B" (0 ?$,1D[(B ?$,1DG(B ?$,1DP(B) (0 ?$,1DQ(B ?$,1DG(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
449 ("$,1D[DG(B" (0 ?$,1D[(B ?$,1DG(B) (0 ?$,1DG(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
450 ("$,1D`DQD]DP(B" (?$,1D`(B 0 ?$,1DQ(B ?$,1D](B ?$,1DP(B) (0 ?$,1DQ(B ?$,1D](B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
451 ("$,1D`DQD](B" (?$,1D`(B 0 ?$,1DQ(B ?$,1D](B) (0 ?$,1D](B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
452 ("$,1D`DVDM(B" (?$,1D`(B 0 ?$,1DV(B ?$,1DM(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
453 ("$,1D`DWDM(B" (?$,1D`(B 0 ?$,1DW(B ?$,1DM(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
454 ("$,1Dd(B" (?$,1Dd(B 0))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
455 ("$,1Dc(B" (?$,1Dc(B 0))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
456 ("$,1D`D[DR(B" (?$,1D`(B 0 ?$,1D[(B ?$,1DR(B))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
457 ("$,1DS(B" (0 ?$,1DS(B)))
26894
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
458 "Alist of Lao vowel string vs the corresponding re-ordering rule.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
459 Each element has this form:
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
460 (VOWEL NO-MAA-SAKOD-RULE WITH-MAA-SAKOD-RULE (MAA-SAKOD-0 RULE-0) ...)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
461
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
462 VOWEL is a vowel string (e.g. \"(1`Q]P(B\").
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
463
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
464 NO-MAA-SAKOD-RULE is a rule to re-order and modify VOWEL following a
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
465 consonant. It is a list vowel characters or 0. The element 0
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
466 indicate the place to embed a consonant.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
467
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
468 Optional WITH-MAA-SAKOD-RULE is a rule to re-order and modify VOWEL
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
469 follwoing a consonant and preceding a maa-sakod character. If it is
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
470 nil, NO-MAA-SAKOD-RULE is used. The maa-sakod character is alwasy
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
471 appended at the tail.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
472
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
473 For instance, rule `(\"(1`WM(B\" (?(1`(B t ?(1W(B ?(1M(B))' tells that this vowel
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
474 string following a consonant `(1!(B' should be re-ordered as \"(1`!WM(B\".
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
475
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
476 Optional (MAA-SAKOD-n RULE-n) are rules specially applied to maa-sakod
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
477 character MAA-SAKOD-n.")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
478
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
479 ;;;###autoload
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
480 (defun lao-transcribe-single-roman-syllable-to-lao (from to &optional str)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
481 "Transcribe a Romanized Lao syllable in the region FROM and TO to Lao string.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
482 Only the first syllable is transcribed.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
483 The value has the form: (START END LAO-STRING), where
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
484 START and END are the beggining and end positions of the Roman Lao syllable,
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
485 LAO-STRING is the Lao character transcription of it.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
486
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
487 Optional 3rd arg STR, if non-nil, is a string to search for Roman Lao
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
488 syllable. In that case, FROM and TO are indexes to STR."
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
489 (if str
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
490 (if (setq from (string-match lao-transcription-pattern str from))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
491 (progn
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
492 (if (>= from to)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
493 (setq from nil)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
494 (setq to (match-end 0)))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
495 (save-excursion
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
496 (goto-char from)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
497 (if (setq to (re-search-forward lao-transcription-pattern to t))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
498 (setq from (match-beginning 0))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
499 (setq from nil))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
500 (if from
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
501 (let* ((consonant (match-string 1 str))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
502 (semivowel (match-string 3 str))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
503 (vowel (match-string 5 str))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
504 (maa-sakod (match-string 8 str))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
505 (tone (match-string 9 str))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
506 lao-consonant lao-semivowel lao-vowel lao-maa-sakod lao-tone
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
507 clen cidx)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
508 (setq to (match-end 0))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
509 (if (not consonant)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
510 (setq str (cdr (assoc (match-string 0 str)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
511 lao-transcription-punctuation-alist)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
512 (setq lao-consonant
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
513 (cdr (assoc consonant lao-transcription-consonant-alist)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
514 (if (vectorp lao-consonant)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
515 (setq lao-consonant (aref lao-consonant 0)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
516 (setq clen (length lao-consonant))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
517 (if semivowel
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
518 ;; Include semivowel in STR.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
519 (setq lao-semivowel
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
520 (cdr (assoc semivowel lao-transcription-semi-vowel-alist))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
521 str (if (= clen 1)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
522 (concat lao-consonant lao-semivowel)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
523 (concat (substring lao-consonant 0 1) lao-semivowel
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
524 (substring lao-consonant 1))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
525 (setq str lao-consonant))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
526 (if vowel
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
527 (let (rule)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
528 (setq lao-vowel
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
529 (cdr (assoc vowel lao-transcription-vowel-alist)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
530 (if (vectorp lao-vowel)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
531 (setq lao-vowel (aref lao-vowel 0)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
532 (setq rule (assoc lao-vowel lao-vowel-reordering-rule))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
533 (if (null maa-sakod)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
534 (setq rule (nth 1 rule))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
535 (setq lao-maa-sakod
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
536 (cdr (assoc maa-sakod lao-transcription-maa-sakod-alist))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
537 rule
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
538 (or (cdr (assq (aref lao-maa-sakod 0) (nthcdr 2 rule)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
539 (nth 2 rule)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
540 (nth 1 rule))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
541 (or rule
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
542 (error "Lao vowel %S has no re-ordering rule" lao-vowel))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
543 (setq lao-consonant str str "")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
544 (while rule
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
545 (if (= (car rule) 0)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
546 (setq str (concat str lao-consonant)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
547 cidx (length str))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
548 (setq str (concat str (list (car rule)))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
549 (setq rule (cdr rule)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
550 (or cidx
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
551 (error "Lao vowel %S has malformed re-ordering rule" vowel))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
552 ;; Set CIDX to after upper or lower vowel if any.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
553 (let ((len (length str)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
554 (while (and (< cidx len)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
555 (memq (get-char-code-property (aref str cidx)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
556 'phonetic-type)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
557 '(vowel-lower vowel-upper)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
558 (setq cidx (1+ cidx))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
559 (if lao-maa-sakod
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
560 (setq str (concat str lao-maa-sakod)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
561 (if tone
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
562 (setq lao-tone
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
563 (cdr (assoc tone lao-transcription-tone-alist))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
564 str (concat (substring str 0 cidx) lao-tone
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
565 (substring str cidx)))))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
566 (list from to (lao-compose-string str)))))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
567
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
568 ;;;###autoload
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
569 (defun lao-transcribe-roman-to-lao-string (str)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
570 "Transcribe Romanized Lao string STR to Lao character string."
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
571 (let ((from 0)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
572 (to (length str))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
573 (lao-str "")
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
574 val)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
575 (while (setq val (lao-transcribe-single-roman-syllable-to-lao from to str))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
576 (let ((start (car val))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
577 (end (nth 1 val))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
578 (lao (nth 2 val)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
579 (if (> start from)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
580 (setq lao-str (concat lao-str (substring str from start) lao))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
581 (setq lao-str (concat lao-str lao)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
582 (setq from end)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
583 (if (< from to)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
584 (concat lao-str (substring str from to))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
585 lao-str)))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
586
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
587 ;;;###autoload
41890
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
588 (defun lao-post-read-conversion (len)
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
589 (lao-compose-region (point) (+ (point) len))
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
590 len)
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
591
fc0965c8ee87 Add Unicode equivalents for rules.
Dave Love <fx@gnu.org>
parents: 38414
diff changeset
592 ;;;###autoload
26894
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
593 (defun lao-composition-function (from to pattern &optional string)
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
594 "Compose Lao text in the region FROM and TO.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
595 The text matches the regular expression PATTERN.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
596 Optional 4th argument STRING, if non-nil, is a string containing text
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
597 to compose.
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
598
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
599 The return value is number of composed characters."
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
600 (if (< (1+ from) to)
48042
7480394b28f4 (lao-composition-function): Don't use prog1.
Dave Love <fx@gnu.org>
parents: 41890
diff changeset
601 (progn
26894
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
602 (if string
29361
a459df8781d0 (lao-composition-function): Fix args to compose-string.
Kenichi Handa <handa@m17n.org>
parents: 28906
diff changeset
603 (compose-string string from to)
26894
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
604 (compose-region from to))
e0a13ff5901d Mostly rewritten.
Kenichi Handa <handa@m17n.org>
parents: 22987
diff changeset
605 (- to from))))
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
606
28791
bdf7581eb093 (lao-compose-region): New function.
Kenichi Handa <handa@m17n.org>
parents: 26894
diff changeset
607 ;;;###autoload
bdf7581eb093 (lao-compose-region): New function.
Kenichi Handa <handa@m17n.org>
parents: 26894
diff changeset
608 (defun lao-compose-region (from to)
bdf7581eb093 (lao-compose-region): New function.
Kenichi Handa <handa@m17n.org>
parents: 26894
diff changeset
609 (interactive "r")
bdf7581eb093 (lao-compose-region): New function.
Kenichi Handa <handa@m17n.org>
parents: 26894
diff changeset
610 (save-restriction
bdf7581eb093 (lao-compose-region): New function.
Kenichi Handa <handa@m17n.org>
parents: 26894
diff changeset
611 (narrow-to-region from to)
bdf7581eb093 (lao-compose-region): New function.
Kenichi Handa <handa@m17n.org>
parents: 26894
diff changeset
612 (goto-char (point-min))
bdf7581eb093 (lao-compose-region): New function.
Kenichi Handa <handa@m17n.org>
parents: 26894
diff changeset
613 (with-category-table lao-category-table
bdf7581eb093 (lao-compose-region): New function.
Kenichi Handa <handa@m17n.org>
parents: 26894
diff changeset
614 (while (re-search-forward lao-composition-pattern nil t)
bdf7581eb093 (lao-compose-region): New function.
Kenichi Handa <handa@m17n.org>
parents: 26894
diff changeset
615 (compose-region (match-beginning 0) (point))))))
bdf7581eb093 (lao-compose-region): New function.
Kenichi Handa <handa@m17n.org>
parents: 26894
diff changeset
616
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
617 ;;
18309
bd8b521f5218 Provide XXX-util instead of
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
618 (provide 'lao-util)
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
619
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49598
diff changeset
620 ;;; arch-tag: 1f828781-3cb8-4695-88af-8f33222338ce
17083
9e6a3e03ed4c Initial revision
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
621 ;;; lao-util.el ends here