diff options
| -rw-r--r-- | lisp/language/lao-util.el | 19 | ||||
| -rw-r--r-- | lisp/language/tibetan.el | 41 |
2 files changed, 11 insertions, 49 deletions
diff --git a/lisp/language/lao-util.el b/lisp/language/lao-util.el index 6b9a8984414..33e98a60d63 100644 --- a/lisp/language/lao-util.el +++ b/lisp/language/lao-util.el | |||
| @@ -301,25 +301,6 @@ | |||
| 301 | (defconst lao-transcription-pattern | 301 | (defconst lao-transcription-pattern |
| 302 | (concat | 302 | (concat |
| 303 | "\\(" | 303 | "\\(" |
| 304 | (mapconcat 'car lao-transcription-consonant-alist "\\|") | ||
| 305 | "\\)\\(" | ||
| 306 | (mapconcat 'car lao-transcription-semi-vowel-alist "\\|") | ||
| 307 | "\\)?\\(\\(" | ||
| 308 | (mapconcat 'car lao-transcription-vowel-alist "\\|") | ||
| 309 | "\\)\\(" | ||
| 310 | (mapconcat 'car lao-transcription-maa-sakod-alist "\\|") | ||
| 311 | "\\)?\\(" | ||
| 312 | (mapconcat (lambda (x) (regexp-quote (car x))) | ||
| 313 | lao-transcription-tone-alist "\\|") | ||
| 314 | "\\)?\\)?\\|" | ||
| 315 | (mapconcat (lambda (x) (regexp-quote (car x))) | ||
| 316 | lao-transcription-punctuation-alist "\\|") | ||
| 317 | ) | ||
| 318 | "Regexp of Roman transcription pattern for one Lao syllable.") | ||
| 319 | |||
| 320 | (defconst lao-transcription-pattern | ||
| 321 | (concat | ||
| 322 | "\\(" | ||
| 323 | (regexp-opt (mapcar 'car lao-transcription-consonant-alist)) | 304 | (regexp-opt (mapcar 'car lao-transcription-consonant-alist)) |
| 324 | "\\)\\(" | 305 | "\\)\\(" |
| 325 | (regexp-opt (mapcar 'car lao-transcription-semi-vowel-alist)) | 306 | (regexp-opt (mapcar 'car lao-transcription-semi-vowel-alist)) |
diff --git a/lisp/language/tibetan.el b/lisp/language/tibetan.el index 1292092c582..2249fa467b1 100644 --- a/lisp/language/tibetan.el +++ b/lisp/language/tibetan.el | |||
| @@ -558,48 +558,29 @@ | |||
| 558 | ("སྨ" . ""))) | 558 | ("སྨ" . ""))) |
| 559 | 559 | ||
| 560 | (defconst tibetan-regexp | 560 | (defconst tibetan-regexp |
| 561 | (let (pattern) | 561 | (regexp-opt |
| 562 | (dolist (alist (list tibetan-precomposed-transcription-alist | 562 | (mapcar (lambda (x) (regexp-quote (car x))) |
| 563 | tibetan-consonant-transcription-alist | 563 | (append tibetan-precomposed-transcription-alist |
| 564 | tibetan-vowel-transcription-alist | 564 | tibetan-consonant-transcription-alist |
| 565 | tibetan-modifier-transcription-alist | 565 | tibetan-vowel-transcription-alist |
| 566 | tibetan-subjoined-transcription-alist) | 566 | tibetan-modifier-transcription-alist |
| 567 | (apply #'concat (nreverse (cdr pattern)))) | 567 | tibetan-subjoined-transcription-alist))) |
| 568 | (dolist (key-val alist) | ||
| 569 | (setq pattern (cons "\\|" (cons (regexp-quote (car key-val)) | ||
| 570 | pattern)))))) | ||
| 571 | "Regexp matching a Tibetan transcription of a composable Tibetan sequence. | 568 | "Regexp matching a Tibetan transcription of a composable Tibetan sequence. |
| 572 | The result of matching is to be used for indexing alists at conversion | 569 | The result of matching is to be used for indexing alists at conversion |
| 573 | from a roman transcription to the corresponding Tibetan character.") | 570 | from a roman transcription to the corresponding Tibetan character.") |
| 574 | 571 | ||
| 575 | (defvar tibetan-precomposed-regexp | 572 | (defvar tibetan-precomposed-regexp |
| 576 | (purecopy | 573 | (purecopy |
| 577 | (let ((l tibetan-precomposed-transcription-alist) | 574 | (concat "^" (regexp-opt |
| 578 | temp) | 575 | (mapcar #'car tibetan-precomposed-transcription-alist) |
| 579 | (setq temp "^\\(") | 576 | t))) |
| 580 | (setq temp | ||
| 581 | (concat temp (car (car l)))) | ||
| 582 | (setq l (cdr l)) | ||
| 583 | (while l | ||
| 584 | (setq temp | ||
| 585 | (concat temp "\\|" (car (car l)))) | ||
| 586 | (setq l (cdr l))) | ||
| 587 | (concat temp "\\)"))) | ||
| 588 | "Regexp string to match a romanized Tibetan complex consonant. | 577 | "Regexp string to match a romanized Tibetan complex consonant. |
| 589 | The result of matching is to be used for indexing alists when the input key | 578 | The result of matching is to be used for indexing alists when the input key |
| 590 | from an input method is converted to the corresponding precomposed glyph.") | 579 | from an input method is converted to the corresponding precomposed glyph.") |
| 591 | 580 | ||
| 592 | (defvar tibetan-precomposition-rule-regexp | 581 | (defvar tibetan-precomposition-rule-regexp |
| 593 | (purecopy | 582 | (purecopy |
| 594 | (let ((l tibetan-precomposition-rule-alist) | 583 | (regexp-opt (mapcar #'car tibetan-precomposition-rule-alist) t)) |
| 595 | temp) | ||
| 596 | (setq temp "\\(") | ||
| 597 | (setq temp (concat temp (car (car l)))) | ||
| 598 | (setq l (cdr l)) | ||
| 599 | (while l | ||
| 600 | (setq temp (concat temp "\\|" (car (car l)))) | ||
| 601 | (setq l (cdr l))) | ||
| 602 | (concat temp "\\)"))) | ||
| 603 | "Regexp string to match a sequence of Tibetan consonantic components. | 584 | "Regexp string to match a sequence of Tibetan consonantic components. |
| 604 | That is, one base consonant and one or more subjoined consonants. | 585 | That is, one base consonant and one or more subjoined consonants. |
| 605 | The result of matching is to be used for indexing alist when the component | 586 | The result of matching is to be used for indexing alist when the component |