[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/leim/quail ipa.el
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] emacs/leim/quail ipa.el |
Date: |
Sun, 30 Aug 2009 23:30:46 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Juri Linkov <jurta> 09/08/30 23:30:46
Modified files:
leim/quail : ipa.el
Log message:
("kirshenbaum-ipa", "x-sampa-ipa"):
Two new input methods, both following widely-used Usenet
conventions for mapping ASCII to the IPA. Kirshenbaum is common in
sci.lang and alt.usage.english, X-SAMPA in various (mostly
European) non-English language fora. X-SAMPA is slightly more
complex to support in Quail that Kirshenbaum, whence the two extra
function and one extra submap to support it.
(x-sampa-prepend-to-keymap-entry): New function.
(x-sampa-underscore-implosive): New function.
(x-sampa-implosive-submap): New Quail submap.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/leim/quail/ipa.el?cvsroot=emacs&r1=1.14&r2=1.15
Patches:
Index: ipa.el
===================================================================
RCS file: /sources/emacs/emacs/leim/quail/ipa.el,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- ipa.el 30 Aug 2009 23:11:48 -0000 1.14
+++ ipa.el 30 Aug 2009 23:30:46 -0000 1.15
@@ -4,6 +4,8 @@
;; 2006, 2007, 2008, 2009
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H14PRO021
+;; Licensed to the Free Software Foundation.
+;; Copyright (C) 2009 Free Software Foundation, Inc.
;; Keywords: multilingual, input method, IPA
@@ -27,6 +29,7 @@
;;; Code:
(require 'quail)
+(eval-when-compile (require 'cl))
(quail-define-package
"ipa" "IPA" "IPA" t
@@ -108,5 +111,405 @@
("`" ?Ë)
(":" ?Ë))
+(quail-define-package
+ "kirshenbaum-ipa" "IPA" "IPA-K" t
+ "The International Phonetic Alphabet, using Kirshenbaum ASCII translit.
+
+Kirshenbaum IPA is an ASCII transliteration of the phonetic alphabet, common
+in the Usenet groups `sci.lang' and `alt.usage.english'. This input method
+allows you to type Kirshenbaum on your ASCII-capable keyboard, producing the
+corresponding actual IPA characters in your editor.
+
+See http://www.kirshenbaum.net/IPA/ascii-ipa.pdf for full details of the
+transliteration.
+
+A caveat with regard to that document; while XEmacs currently preserves
+Unicode diacritics on reading and emitting them, it displays them,
+incorrectly, as separate from the modified glyphs.")
+
+(quail-define-rules
+ ("r" "ɹ") ;; Alveolar approximant U+0279
+ ("A" "É") ;; Low back unrounded vowel U+0251
+ ("B" "β") ;; Voiced bilabial fricative U+03B2
+ ("C" "ç") ;; Voiced palatal fricative U+00E7
+ ("D" "ð") ;; Voiced dental fricative U+00F0
+ ("E" "É") ;; Lower-mid front unrounded vowel U+025B
+ ("G" "É¢") ;; Voiced uvular stop U+0262
+ ("H" "ħ") ;; Voiced pharyngeal fricative U+0127
+ ("I" "ɪ") ;; Semi-high front unrounded vowel U+026A
+ ("J" "É") ;; Voiced palatal stop U+025F
+ ("L" ["É«" ;; Voiced velar lateral U+026B
+ "Ê" ;; Voiced velar lateral U+029F
+ "ɬ"]) ;; Voiced alveolar lateral fricative U+026C
+ ("M" "ɱ") ;; Labio-dental nasal U+0271
+ ("N" "Å") ;; Velar nasal U+014B
+ ("O" "É") ;; Low-mid back rounded vowel U+0254
+ ("P" "ɸ") ;; Voiceless bilabial fricative U+0278
+ ("Q" "É£") ;; Voiced velar fricative U+0263
+ ("R" ["Ê" ;; Alveolar trill U+0280
+ "É"]) ;; Rhotacised schwa U+025A
+ ("@<r>" "É") ;; Mid central rhotacised vowel U+025A
+ ("S" "Ê") ;; Voiced postalveolar fricative U+0283
+ ("T" "θ") ;; Voiced dental fricative U+03B8
+ ("U" "Ê") ;; Semi-high back rounded vowel U+028A
+ ("V" "Ê") ;; Low-mid back unrounded vowel U+028C
+ ("W" "Å") ;; Low-mid front rounded vowel U+0153
+ ("X" "Ï") ;; Voiceless uvular fricative U+03C7
+ ("Y" "ø") ;; Upper-mid front rounded vowel U+00F8
+ ("Z" "Ê") ;; Voiced postalveolar fricative U+0292
+ ("?" "Ê") ;; Glottal stop U+0294
+ ("@" "É") ;; Mid central unrounded vowel (schwa) U+0259
+ ("&" "æ") ;; Low front unrounded vowel U+00E6
+ ("*" "ɾ") ;; Voiced alveolar flap U+027E
+
+ ("a~" "ã") ;; Low central unrounded vowel, nasal U+00E3
+ ("o~" "õ") ;; Upper-mid back rounded vowel, nasal U+00F5
+ ("u~" "Å©") ;; High back rounded vowel, nasal U+0169
+ ("~" "Ì") ;; +Nasalised modifier U+0303
+ (":" "Ë") ;; +Long modifier U+02D0
+ ("-" "Ì©") ;; +Syllabic modifier U+0329
+ ("." "Ì£") ;; +Retroflex modifier U+0323
+ ("`" "ʼ") ;; +Ejective modifier U+02BC
+ ("[" "̪") ;; +Dental modifier U+032A
+ (";" "ʲ") ;; +Palatalised modifier U+02B2
+ ("<H>" "Ì´") ;; +Pharyngealised modifier U+0334
+ ("<h>" "ʰ") ;; +Aspirated modifier U+02B0
+ ("<o>" ["Ì¥" ;; +Voiceless modifier U+0325
+ "Ë"]) ;; +Unexploded modifier U+02DA
+ ("<r>" "ʳ") ;; +Rhotacised modifier U+02B3
+ ("<w>" "Ê·") ;; +Labialised modifier U+02B7
+ ("<?>" "ʱ") ;; +Murmured modififer U+02B1
+
+ ("b<trl>" "Ê") ;; Bilabial trill U+0299
+ ("b`" "É") ;; Bilabial implosive U+0253
+ ("p!" "Ê") ;; Bilabial click U+0298
+ ("r<lbd>" "Ê") ;; Labio-dental approximant U+028B
+ ("d`" "É") ;; Dental implosive U+0257
+ ("t!" "Ê") ;; Dental click U+0287
+ ("s<lat>" "ɬ") ;; Voiceless alveolar lateral fricative U+026C
+ ("z<lat>" "É®") ;; Voiced alveolar lateral fricative U+026E
+ ("r<trl>" "Ê") ;; Alveolar trill U+0280
+
+ ("*<lat>" "ɺ") ;; Voiced alveolar lateral flap U+027A
+ ("c!" "Ê") ;; Alveolar click U+0297
+ ("l!" "Ê") ;; Alveolar lateral click U+0296
+ ("n." "ɳ") ;; Retroflex nasal U+0273
+ ("t." "Ê") ;; Voiceless retroflex stop U+0288
+ ("d." "É") ;; Voiced retroflex stop U+0256
+ ("s." "Ê") ;; Voiceless retroflex fricative U+0282
+ ("z." "Ê") ;; Voiceless retroflex fricative U+0290
+ ("r." "É»") ;; Retroflex approximant U+027B
+ ("l." "É") ;; Retroflex lateral U+026D
+ ("*." "ɽ") ;; Retroflex flap U+027D
+
+ ("C<vcd>" "Ê") ;; Voiced palatal fricative U+029D
+ ("j<rnd>" "É¥") ;; Rounded palatal approximant U+0265
+ ("l^" "Ê") ;; Palatal lateral U+028E
+ ("J`" "Ê") ;; Palatal implosive U+0284
+ ("j<vel>" "ɰ") ;; Velar approximant U+0270
+ ("g`" "É ") ;; Velar implosive U+0260
+ ("k!" "Ê") ;; Velar click U+029E
+
+ ("n<lbv>" ["nâg"]) ;; Labio-velar nasal
+ ("t<lbv>" ["kâp"]) ;; Voiceless labio-velar stop
+
+ ;; "n<lbv> for "gb" WITH U+2030 CHARACTER TIE was ambiguous and
+ ;; misleading. I _believe_ this is what was meant instead.
+ ("d<lbv>" ["gâb"]) ;; Voiced labio-velar stop.
+
+ ("w<vls>" "Ê") ;; Voiceless labio-velar stop U+028D
+ ("n\"" "É´") ;; Uvular nasal U+0274
+ ("g\"" "Ê") ;; Voiced uvular fricative U+0281
+ ("r\"" "Ê") ;; Uvular trill U+0280
+ ("G`" "Ê") ;; Voiced uvular implosive U+029B
+ ("H<vcd>" "Ê") ;; Voiced pharyngeal fricative U+0295
+
+ ("h<?>" "ɦ") ;; Murmured glottal fricative U+0266
+ ("I." "Ê") ;; Semi-high front rounded vowel U+028F
+ ("&." "ɶ") ;; Low front unrounded vowel U+0276
+
+ ("i\"" "ɨ") ;; High central unrounded vowel U+0268
+ ("u\"" "Ê") ;; High central rounded vowel U+0289
+ ("@<umd>" "É") ;; Upper-mid central unrounded vowel U+0258
+
+ ("R<umd>" "É") ;; Upper-mid central rhotacised vowel U+025D
+
+ ("@." "ɵ") ;; Mid central rounded vowel U+0275
+ ("V\"" "É") ;; Lower-mid central unrounded vowel U+025C
+ ("O\"" "É") ;; Lower-mid central rounded vowel U+025E
+ ("u-" "ɯ") ;; High back unrounded vowel U+026F
+ ("o-" "ɤ") ;; Upper-mid back unrounded vowel U+0264
+ ("A." "É")) ;; Lower back rounded vowel U+0252
+
+;; On XEmacs, with the supplied X-SAMPA data, this function is capably
+;; implemented with:
+;;
+;; (list (vector (concat to-prepend quail-keymap)))
+;;
+;; Supporting GNU Emacs too makes it a good deal more complicated.
+
+(defun x-sampa-prepend-to-keymap-entry (to-prepend quail-keymap)
+ "Return QUAIL-KEYMAP with TO-PREPEND at the beginning of each result.
+
+QUAIL-KEYMAP is a cons that satisfies `quail-map-p'; TO-PREPEND is a
+string."
+ (when (consp quail-keymap) (setq quail-keymap (cdr quail-keymap)))
+ (if (or (integerp quail-keymap)
+ (and (fboundp 'characterp) (characterp quail-keymap)))
+ (setq quail-keymap (list (string quail-keymap)))
+ (if (stringp quail-keymap)
+ (setq quail-keymap (list quail-keymap))
+ (assert (vectorp quail-keymap) t)
+ (setq quail-keymap (append quail-keymap nil))))
+ (list
+ (apply 'vector
+ (mapcar
+ #'(lambda (entry)
+ (assert (char-or-string-p entry) t)
+ (format "%s%s" to-prepend
+ (if (integerp entry) (string entry) entry)))
+ quail-keymap))))
+
+(defun x-sampa-underscore-implosive (input-string length)
+ "Return keymap with IPA implosives, for INPUT-STRING, length LENGTH.
+
+The implosive consonants in X-SAMPA are represented with more or less a
+diacritic syntax, but the property +implosive in the IPA is expressed using
+separate characters, and not using a diacritic. This function works around
+the confusion that implies when generating IPA from X-SAMPA; it returns a
+Quail map that is a copy of the map for `_', but with all the DIACRITIC
+entries changed to return the diacritic together with the base character,
+and with the map to the implosive added to its end.
+
+Like all `quail-defrule'-assigned functions, this will be called once for
+each particular sequence of keys, the first time the user types that
+particular sequence of keys, and the result will be cached by Quail."
+ (let* ((input-string (substring input-string 0 (or length)))
+ (underscore-map (copy-tree (quail-lookup-key "_")))
+ (split-input (split-string input-string "_"))
+ (pre-underscore (car split-input))
+ (pre-underscore-map (quail-lookup-key pre-underscore))
+ (x-sampa-submap-entry
+ (assoc (format "%s<" input-string) x-sampa-implosive-submap))
+ underscore-map-entry)
+ (if (and (consp pre-underscore-map) (car pre-underscore-map))
+ (setq pre-underscore-map (car pre-underscore-map))
+ (setq pre-underscore-map pre-underscore))
+ (unless (stringp pre-underscore-map)
+ (setq pre-underscore-map (string pre-underscore-map)))
+ (dolist (underscoring underscore-map)
+ (cond ((null underscoring))
+ ((eq (length underscoring) 2)
+ (setq underscore-map-entry (second underscoring))
+ (setcdr underscoring (x-sampa-prepend-to-keymap-entry
+ pre-underscore-map underscore-map-entry)))
+ ((eq (length underscoring) 3)
+ (setq underscore-map-entry (second (third underscoring)))
+ (setcdr (third underscoring)
+ (x-sampa-prepend-to-keymap-entry
+ pre-underscore-map underscore-map-entry)))
+ (t
+ (assert (null t) t
+ "Can't handle subtrees of this level right now."))))
+ (append underscore-map (list (list ?< (second x-sampa-submap-entry))))))
+
+(quail-define-package
+ "x-sampa-ipa" "IPA" "IPA-X" t
+ "The International Phonetic Alphabet, using J.C. Wells' X-SAMPA.
+
+X-SAMPA is an ASCII transliteration of the IPA, normally used for data
+exchange in environments where Unicode is not available. This input method
+uses this transliteration to allow you to produce the IPA in your editor
+with a keyboard that's limited to ASCII.
+
+See http://www.phon.ucl.ac.uk/home/sampa/ipasam-x.pdf for a full definition
+of the mapping. A caveat with regard to that document; while XEmacs
+currently preserves Unicode diacritics on reading and emitting them, it
+displays them, incorrectly, as separate from the modified glyphs." nil t t)
+
+(quail-define-rules
+ ;; Table taken from http://en.wikipedia.org/wiki/X-SAMPA, checked with
+ ;; http://www.phon.ucl.ac.uk/home/sampa/ipasam-x.pdf
+
+ ("d`" "É") ;; Voiced retroflex plosive U+0256
+
+ ;; In the Wikipedia article, they list ASCII g as mapping to U+0261, LATIN
+ ;; SMALL LETTER SCRIPT G. The typeset g is equally acceptable as the voiced
+ ;; velar plosive, however, and we don't override the identity mapping here.
+
+ ("h\\" "ɦ") ;; Voiced glottal fricative U+0266
+ ("j\\" "Ê") ;; Voiced palatal fricative U+029D
+ ("l`" "É") ;; Retroflex lateral approximant U+026D
+ ("l\\" "ɺ") ;; Alveolar lateral flap U+027A
+ ("n`" "ɳ") ;; Retroflex nasal U+0273
+ ("p\\" "ɸ") ;; Voiceless bilabial fricative U+0278
+ ("r`" "ɽ") ;; Retroflex flap U+027D
+ ("r\\" "ɹ") ;; Alveolar approximant U+0279
+ ("r\\`" "É»") ;; Retroflex approximant U+027B
+ ("s`" "Ê") ;; Voiceless retroflex fricative U+0282
+ ("s\\" "É") ;; Voiceless alveolo-palatal fricative U+0255
+ ("t`" "Ê") ;; Voiceless retroflex plosive U+0288
+ ("v\\" "Ê") ;; Labiodental approximant U+028B
+ ("x\\" "ɧ") ;; Voiceless palatal-velar fricative U+0267
+ ("z`" "Ê") ;; Voiced retroflex fricative U+0290
+ ("z\\" "Ê") ;; Voiced alveolo-palatal fricative U+0291
+ ("A" "É") ;; Open back unrounded vowel U+0251
+ ("B" "β") ;; Voiced bilabial fricative U+03B2
+ ("B\\" "Ê") ;; Bilabial trill U+0299
+ ("C" "ç") ;; Voiceless palatal fricative U+00E7
+ ("D" "ð") ;; Voiced dental fricative U+00F0
+ ("E" "É") ;; Open-mid front unrounded vowel U+025B
+ ("F" "ɱ") ;; Labiodental nasal U+0271
+ ("G" "É£") ;; Voiced velar fricative U+0263
+ ("G\\" "É¢") ;; Voiced uvular plosive U+0262
+ ("H" "É¥") ;; Labial-palatal approximant U+0265
+ ("H\\" "Ê") ;; Voiceless epiglottal fricative U+029C
+ ("I" "ɪ") ;; Near-close near-front unrounded vowel U+026A
+ ("I\\" "Æ") ;; Central lax close unrounded vowel U+0197
+ ("J" "ɲ") ;; Palatal nasal U+0272
+ ("J\\" "É") ;; Voiceless palatal plosive U+025F
+ ("K" "ɬ") ;; Voiceless alveolar lateral fricative U+026C
+ ("K\\" "É®") ;; Voiced alveolar lateral fricative U+026E
+ ("L" "Ê") ;; Palatal lateral approximant U+028E
+ ("L\\" "Ê") ;; Velar lateral approximant U+029F
+ ("M" "ɯ") ;; Close back unrounded vowel U+026F
+ ("M\\" "ɰ") ;; Velar approximant U+0270
+ ("N" "Å") ;; Velar nasal U+014B
+ ("N\\" "É´") ;; Uvular nasal U+0274
+ ("O" "É") ;; Open-mid back rounded vowel U+0254
+ ("O\\" "Ê") ;; Bilabial click U+0298
+ ("P" "Ê") ;; Labiodental approximant U+028B
+ ("Q" "É") ;; Open back rounded vowel U+0252
+ ("R" "Ê") ;; Voiced uvular fricative U+0281
+ ("R\\" "Ê") ;; Uvular trill U+0280
+ ("S" "Ê") ;; Voiceless postalveolar fricative U+0283
+ ("T" "θ") ;; Voiceless dental fricative U+03B8
+ ("U" "Ê") ;; Near-close near-back rounded vowel U+028A
+ ("U\\" ["Ê̵"]) ;; Central lax close rounded vowel, U+028A U+0335
+ ("V" "Ê") ;; Open-mid back unrounded vowel U+028C
+ ("W" "Ê") ;; Voiceless labial-velar fricative U+028D
+ ("X" "Ï") ;; Voiceless uvular fricative U+03C7
+ ("X\\" "ħ") ;; Voiceless pharyngeal fricative U+0127
+ ("Y" "Ê") ;; Near-close near-front rounded vowel U+028F
+ ("Z" "Ê") ;; Voiced postalveolar fricative U+0292
+
+ ("\"" "Ë") ;; Primary stress U+02C8
+ ("%" "Ë") ;; Secondary stress U+02CC
+ (":" "Ë") ;; Long U+02D0
+ (":\\" "Ë") ;; Half-long U+02D1
+ ("@" "É") ;; Schwa U+0259
+ ("@\\" "É") ;; Close-mid central unrounded vowel U+0258
+ ("@`" "É") ;; Rhotacised schwa U+025A
+ ("{" "æ") ;; Near-open front unrounded vowel U+00E6
+ ("}" "Ê") ;; Close central rounded vowel U+0289
+ ("1" "ɨ") ;; Close central unrounded vowel U+0268
+ ("2" "ø") ;; Close-mid front rounded vowel U+00F8
+ ("3" "É") ;; Open-mid central unrounded vowel U+025C
+ ("3\\" "É") ;; Open-mid central rounded vowel U+025E
+ ("4" "ɾ") ;; Alveolar flap U+027E
+ ("5" "É«") ;; Velarised alveolar lateral approximant U+026B
+ ("6" "É") ;; Near-open central vowel U+0250
+ ("7" "ɤ") ;; Close-mid back unrounded vowel U+0264
+ ("8" "ɵ") ;; Close-mid central rounded vowel U+0275
+ ("9" "Å") ;; Open-mid front rounded vowel U+0153
+ ("&" "ɶ") ;; Open front rounded vowel U+0276
+ ("?" "Ê") ;; Glottal stop U+0294
+ ("?\\" "Ê") ;; Voiced pharyngeal fricative U+0295
+ ;; The undefined escape character, ignored.
+ ;; Indeterminacy in French vowels, ignored.
+ ;; Begin nonsegmental notation, ignored.
+ ("<\\" "Ê¢") ;; Voiced epiglottal fricative U+02A2
+ ;; End nonsegmental notation, ignored.
+ (">\\" "Ê¡") ;; Epiglottal plosive U+02A1
+ ("^" "â") ;; Upstep U+2191
+ ("!" "â") ;; Downstep U+2193
+ ("!\\" "Ç") ;; Postalveolal click U+01C3
+ ("\\" "Ç") ;; Dental click U+01C0
+ ("\\|\\" "Ç") ;; Lateral alveolar click U+01C1
+ ("=\\" "Ç") ;; Palatal click U+01C2
+ ("-\\" "Ì®") ;; Linking mark U+032E
+
+ ;; Diacritics. Note that XEmacs doesn't yet have composed characters, so we
+ ;; can input them, but they won't display properly. If you send email using
+ ;; them, and the recipient's client is capable, they will get through,
+ ;; though.
+
+ ("_\"" "Ì") ;; Centralised U+0308
+ ("_+" "Ì") ;; Advanced U+031F
+ ("_-" "Ì ") ;; Retracted U+0320
+ ("_/" "Ë") ;; Rising tone U+02C7
+ ("_0" "Ì¥") ;; Voiceless U+0325
+ ("_=" "Ì©") ;; Syllabic U+0329
+ ("=" "Ì©") ;; Syllabic U+0329
+ ("_>" "ʼ") ;; Ejective U+02BC
+ ("_?\\" "ˤ") ;; Pharyngealised U+02E4
+ ("_\\" "Ë") ;; Falling Tone U+02C6
+ ("_^" "̯") ;; Non-syllabic U+032F
+ ("_}" "Ì") ;; No audible release U+031A
+ ;; ` is alternatively; retroflexion in consonants
+ ("`" "Ë") ;; Rhotacization in vowels U+02DE
+ ("_~" "Ì") ;; Nasalisation U+0303
+ ("~" "Ì") ;; Nasalisation U+0303
+ ("_A" "Ì") ;; Advanced tongue root U+0318
+ ("_a" "̺") ;; Apical U+033A
+ ("_B" "Ì") ;; Extra low tone U+030F
+ ;; _B_L omitted, no Unicode code point for "low rising tone."
+ ("_c" "Ì") ;; Less rounded U+031C
+ ("_d" "̪") ;; Dental U+032A
+ ("_e" "Ì´") ;; Velarised or pharyngeal U+0334
+
+ ("<F>" "â") ;; Global fall; SOUTH EAST ARROW; may be a bit smaller than
+ ;; intended.
+ ("_F" "Ì") ;; Falling tone U+0302
+ ("_G" "Ë ") ;; Velarised U+02E0
+ ("_H" "Ì") ;; High tone U+0301
+ ;; "_H_T omitted, no Unicode code point for "high rising tone"
+ ("_h" "ʰ") ;; Aspirated U+02B0
+ ("_j" "ʲ") ;; Palatalised U+02B2
+ ("'" "ʲ") ;; Palatalised U+02B2
+ ("_k" "̰") ;; Creaky voice U+0330
+ ("_L" "Ì") ;; Low tone U+0300
+ ("_l" "Ë¡") ;; Lateral release U+02E1
+ ("_M" "Ì") ;; Mid tone U+0304
+ ("_m" "Ì»") ;; Laminal U+033B
+ ("_N" "̼") ;; Linguolabial U+033C
+ ("_n" "â¿") ;; Nasal release U+207F
+ ("_O" "̹") ;; More rounded U+0339
+ ("_o" "Ì") ;; Lowered U+031E
+ ("_q" "Ì") ;; Retracted tongue root U+0319
+ ("<R>" "â") ;; NORTH EAST ARROW; may be a bit smaller than intended.
+ ("_R" "Ì") ;; HaÄek, caron, rising tone. U+030C
+ ;; _R_F omitted, apparently there's no corresponding Unicode entry.
+ ("_r" "Ì") ;; Raised U+031D
+ ("_T" "Ì") ;; Extra high tone U+030B
+ ("_t" "̤") ;; Breathy voice U+0324
+ ("_v" "̬") ;; Voiced U+032C
+ ("_w" "Ê·") ;; Labialised U+02B7
+ ("_X" "Ì") ;; Extra-short U+0306
+ ("_x" "̽")) ;; Mid-centralised U+033D
+
+(defconst x-sampa-implosive-submap
+ '(("b_<" ?É) ;; Voiced bilabial implosive U+0253
+ ("d_<" ?É) ;; Voiced alveolar implosive U+0257
+ ("g_<" ?É ) ;; Voiced velar implosive U+0260
+ ("G\\_<" ?Ê) ;; Voiced uvular implosive U+029B
+ ("J\\_<" ?Ê)) ;; Voiced palatal implosive U+0284
+ "A map from the X-SAMPA for some implosive consonants to characters.
+This is used because their X-SAMPA syntax is quasi-diacritic, but the
+corresponding Unicode characters themselves don't have diacritics, they are
+separate code points. So we need to implement some extra logic that isn't
+normally provided by Quail.")
+
+;; Putting in place rules for the implosives like for the others above
+;; breaks the "_<diacritic>" rules for b, d, g, G and J a little--you need
+;; to interrupt Quail before typing the underscore if you want the
+;; diacritic. To avoid this, handle the input specially with the function
+;; x-sampa-underscore-implosive.
+
+(dolist (implosive-x-sampa (mapcar 'car x-sampa-implosive-submap))
+ (setq implosive-x-sampa (car (split-string implosive-x-sampa "_")))
+ (quail-defrule (format "%s_" implosive-x-sampa)
+ 'x-sampa-underscore-implosive))
+
;; arch-tag: cf2614cc-ecce-4ef5-ba51-37faeed41691
;;; ipa.el ends here