annotate leim/quail/sisheng.el @ 88156:bae375b92d33

*** empty log message ***
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 01:18:13 +0000
parents d7ddb3e565de
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
88155
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
1 ;;; sisheng.el --- sisheng input method for Chinese pinyin transliteration
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
2
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
3 ;; Copyright (C) 2004 Free Software Foundation, Inc.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
4
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
5 ;; Author: Werner LEMBERG <wl@gnu.org>
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
6
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
7 ;; Keywords: multilingual, input method, Chinese, pinyin, sisheng
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
8
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
9 ;; This program is free software; you can redistribute it and/or modify
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
12 ;; any later version.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
13
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
14 ;; This program is distributed in the hope that it will be useful,
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
17 ;; GNU General Public License for more details.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
18
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
21 ;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
22 ;; Boston, MA 02110-1301, USA.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
23
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
24 ;;; Commentary:
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
25
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
26 ;;; Code:
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
27
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
28 (require 'quail)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
29
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
30 (defconst sisheng-regexp
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
31 "[āēīōūǖ]\\|üē")
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
32
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
33 ;; First element is the key,
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
34 ;; second element is the vowel used for the input sequence,
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
35 ;; last four elements are the resulting tones.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
36 ;;
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
37 (defconst sisheng-vowel-table
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
38 '(("ā" "a" "ā" "á" "ǎ" "à")
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
39 ("ē" "e" "ē" "é" "ě" "è")
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
40 ("ī" "i" "ī" "í" "ǐ" "ì")
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
41 ("ō" "o" "ō" "ó" "ǒ" "ò")
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
42 ("ū" "u" "ū" "ú" "ǔ" "ù")
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
43 ("ǖ" "v" "ǖ" "ǘ" "ǚ" "ǜ")
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
44 ("üē" "ve" "üē" "üé" "üě" "üè")))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
45
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
46
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
47 ;; All possible syllables in Mandarin Chinese, presented in the first
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
48 ;; tone. Note that make-sisheng-rules always constructs rules for all
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
49 ;; four tones even if some of those tones aren't used in Mandarin.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
50 ;;
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
51 (defconst sisheng-syllable-table
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
52 '("ā" "āi" "ān" "āng" "āo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
53
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
54 "bā" "bāi" "bān" "bāng" "bāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
55 "bēi" "bēn" "bēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
56 "bī" "biān" "biāo" "biē" "bīn" "bīng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
57 "bō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
58 "bū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
59
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
60 "cā" "cāi" "cān" "cāng" "cāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
61 "cē" "cēn" "cēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
62 "cī"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
63 "cōng" "cōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
64 "cū" "cuān" "cuī" "cūn" "cuō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
65
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
66 "chā" "chāi" "chān" "chāng" "chāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
67 "chē" "chēn" "chēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
68 "chī"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
69 "chōng" "chōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
70 "chū" "chuā" "chuāi" "chuān" "chuāng" "chuī" "chūn" "chuō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
71
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
72 "dā" "dāi" "dān" "dāng" "dāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
73 "dē" "dēi" "dēn" "dēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
74 "dī" "diān" "diāo" "diē" "dīng" "diū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
75 "dōng" "dōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
76 "dū" "duān" "duī" "dūn" "duō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
77
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
78 "ē" "ēi" "ēn" "ēng" "ēr"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
79
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
80 "fā" "fān" "fāng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
81 "fēi" "fēn" "fēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
82 "fiāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
83 "fō" "fōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
84 "fū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
85
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
86 "gā" "gāi" "gān" "gāng" "gāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
87 "gē" "gēi" "gēn" "gēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
88 "gōng" "gōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
89 "gū" "guā" "guāi" "guān" "guāng" "guī" "gūn" "guō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
90
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
91 "hā" "hāi" "hān" "hāng" "hāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
92 "hē" "hēi" "hēn" "hēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
93 "hōng" "hōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
94 "hū" "huā" "huāi" "huān" "huāng" "huī" "hūn" "huō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
95
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
96 "jī" "jiā" "jiān" "jiāng" "jiāo" "jiē" "jīn" "jīng" "jiōng" "jiū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
97 "jū" "juān" "juē" "jūn"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
98
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
99 "kā" "kāi" "kān" "kāng" "kāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
100 "kē" "kēi" "kēn" "kēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
101 "kōng" "kōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
102 "kū" "kuā" "kuāi" "kuān" "kuāng" "kuī" "kūn" "kuō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
103
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
104 "lā" "lāi" "lān" "lāng" "lāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
105 "lē" "lēi" "lēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
106 "lī" "liā" "liān" "liāng" "liāo" "liē" "līn" "līng" "liū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
107 "lōng" "lōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
108 "lū" "luān" "lūn" "luō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
109 "lǖ" "lüē"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
110
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
111 "mā" "māi" "mān" "māng" "māo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
112 "mē" "mēi" "mēn" "mēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
113 "mī" "miān" "miāo" "miē" "mīn" "mīng" "miū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
114 "mō" "mōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
115 "mū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
116
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
117 "nā" "nāi" "nān" "nāng" "nāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
118 "nē" "nēi" "nēn" "nēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
119 "nī" "niān" "niāng" "niāo" "niē" "nīn" "nīng" "niū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
120 "nōng" "nōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
121 "nū" "nuān" "nuō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
122 "nǖ" "nüē"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
123
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
124 "ō" "ōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
125
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
126 "pā" "pāi" "pān" "pāng" "pāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
127 "pēi" "pēn" "pēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
128 "pī" "piān" "piāo" "piē" "pīn" "pīng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
129 "pō" "pōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
130 "pū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
131
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
132 "qī" "qiā" "qiān" "qiāng" "qiāo" "qiē" "qīn" "qīng" "qiōng" "qiū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
133 "qū" "quān" "quē" "qūn"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
134
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
135 "rān" "rāng" "rāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
136 "rē" "rēn" "rēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
137 "rī"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
138 "rōng" "rōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
139 "rū" "ruā" "ruān" "ruī" "rūn" "ruō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
140
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
141 "sā" "sāi" "sān" "sāng" "sāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
142 "sē" "sēn" "sēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
143 "sī"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
144 "sōng" "sōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
145 "sū" "suān" "suī" "sūn" "suō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
146
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
147 "shā" "shāi" "shān" "shāng" "shāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
148 "shē" "shēi" "shēn" "shēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
149 "shī"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
150 "shōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
151 "shū" "shuā" "shuāi" "shuān" "shuāng" "shuī" "shūn" "shuō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
152
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
153 "tā" "tāi" "tān" "tāng" "tāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
154 "tē" "tēi" "tēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
155 "tī" "tiān" "tiāo" "tiē" "tīng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
156 "tōng" "tōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
157 "tū" "tuān" "tuī" "tūn" "tuō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
158
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
159 "wā" "wāi" "wān" "wāng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
160 "wēi" "wēn" "wēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
161 "wō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
162 "wū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
163
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
164 "xī" "xiā" "xiān" "xiāng" "xiāo" "xiē" "xīn" "xīng" "xiōng" "xiū"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
165 "xū" "xuān" "xuē" "xūn"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
166
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
167 "yā" "yān" "yāng" "yāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
168 "yē"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
169 "yī" "yīn" "yīng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
170 "yō" "yōng" "yōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
171 "yū" "yuān" "yuē" "yūn"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
172
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
173 "zā" "zāi" "zān" "zāng" "zāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
174 "zē" "zēi" "zēn" "zēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
175 "zī"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
176 "zōng" "zōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
177 "zū" "zuān" "zuī" "zūn" "zuō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
178
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
179 "zhā" "zhāi" "zhān" "zhāng" "zhāo"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
180 "zhē" "zhēi" "zhēn" "zhēng"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
181 "zhī"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
182 "zhōng" "zhōu"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
183 "zhū" "zhuā" "zhuāi" "zhuān" "zhuāng" "zhuī" "zhūn" "zhuō"))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
184
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
185 ;; This function converts e.g.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
186 ;;
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
187 ;; "zhuō"
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
188 ;;
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
189 ;; into
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
190 ;;
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
191 ;; (("zhuo4" ["zhuò"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
192 ;; ("zhuo3" ["zhuǒ"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
193 ;; ("zhuo2" ["zhuó"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
194 ;; ("zhuo1" ["zhuō"]))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
195 ;;
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
196 (defun quail-make-sisheng-rules (syllable)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
197 (let ((case-fold-search t)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
198 vowel-match
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
199 vowel-list
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
200 input-vowel
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
201 base-key
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
202 key
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
203 value
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
204 key-value-list
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
205 (i 1))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
206 (string-match sisheng-regexp syllable)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
207 (setq vowel-match (downcase (match-string 0 syllable)))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
208 (setq vowel-list
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
209 (cdr (assoc-string vowel-match sisheng-vowel-table)))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
210 (setq input-vowel (car vowel-list))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
211 (setq base-key (replace-match input-vowel nil nil syllable))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
212 (while (<= i 4)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
213 (setq key (concat base-key (number-to-string i)))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
214 (setq value (vector (replace-match (nth i vowel-list) nil nil syllable)))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
215 (push (list key value) key-value-list)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
216 (setq i (1+ i)))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
217 key-value-list))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
218
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
219 ;; Set up sisheng input method.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
220 ;;
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
221 (quail-define-package
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
222 "chinese-sisheng" ; name
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
223 "Chinese" ; language
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
224 "ǚ" ; title
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
225 t ; guidance
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
226 "Sìshēng input method for pīnyīn transliteration of Chinese.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
227
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
228 Examples: shuang1 -> shuāng
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
229 Lv3 -> Lǚ
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
230 AN4 -> ÀN
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
231
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
232 Use the fifth (unstressed) tone for syllables containing `ü'
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
233 without a tone mark.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
234
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
235 Example: nve5 -> nüe
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
236 " ; docstring
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
237 nil ; translation-keys
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
238 t ; forget-last-selection
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
239 nil ; deterministic
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
240 nil ; kbd-translate
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
241 nil ; show-layout
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
242 nil ; create-decode-map
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
243 nil ; maximum-shortest
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
244 nil ; overlay-plist
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
245 nil ; update-translation-function
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
246 nil ; conversion-keys
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
247 t ; simple
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
248 )
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
249
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
250 ;; Call quail-make-sisheng-rules for all syllables in sisheng-syllable-table.
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
251 ;;
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
252 (let ((case-table-save (current-case-table))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
253 sisheng-list)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
254 (set-case-table (standard-case-table))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
255 (dolist (syllable sisheng-syllable-table)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
256 (setq sisheng-list
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
257 (append (quail-make-sisheng-rules syllable)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
258 sisheng-list)))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
259
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
260 (dolist (syllable sisheng-syllable-table)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
261 (setq sisheng-list
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
262 (append (quail-make-sisheng-rules (upcase-initials syllable))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
263 sisheng-list)))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
264
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
265 (dolist (syllable sisheng-syllable-table)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
266 (setq sisheng-list
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
267 (append (quail-make-sisheng-rules (upcase syllable))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
268 sisheng-list)))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
269
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
270 (eval `(quail-define-rules
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
271 ,@sisheng-list
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
272
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
273 ("lv5" ["lü"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
274 ("lve5" ["lüe"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
275 ("nv5" ["nü"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
276 ("nve5" ["nüe"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
277
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
278 ("Lv5" ["Lü"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
279 ("Lve5" ["Lüe"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
280 ("Nv5" ["Nü"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
281 ("Nve5" ["Nüe"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
282
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
283 ("LV5" ["LÜ"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
284 ("LVE5" ["LÜE"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
285 ("NV5" ["NÜ"])
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
286 ("NVE5" ["NÜE"])))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
287 (set-case-table case-table-save))
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
288
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
289 ;; Local Variables:
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
290 ;; coding: utf-8
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
291 ;; End:
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
292
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents:
diff changeset
293 ;;; arch-tag: 1fa6ba5f-6747-44bc-bf12-30628ad3e8ad