;ELC ;;; compiled by nk@localhost.localdomain on Fri Dec 1 22:48:58 2006 ;;; from file /home/nk/pkg-build/test/mule-packages/mule-base/thai-xtis-util.el ;;; emacs version 21.4 (patch 19) "Constant Variable" XEmacs Lucid. ;;; bytecomp version 2.27 XEmacs; 2000-09-12. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 19. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "20"))) (error "`thai-xtis-util.el' was compiled for Emacs 20")) (or (boundp 'current-load-list) (setq current-load-list nil)) (byte-code "!B!!Ȫ!\"B!\"" [current-load-list require overlay thai-xtis-generic-char default-boundp set-default featurep xemacs thai-xtis make-char thai-xtis-char-regexp "\\cx"] 4) #@40 Non-nil if using Thai text minor mode. (defvar thai-xtis-text-mode nil (#$ . 828)) (make-variable-buffer-local 'thai-xtis-text-mode) #@34 Keymap for Thai Text minor mode. (defvar thai-xtis-text-mode-map (byte-code " #####!##############)" [map make-sparse-keymap define-key "" thai-xtis-forward-word "" thai-xtis-backward-word "" thai-xtis-kill-word "" thai-xtis-backward-kill-word "" thai-xtis-transpose-words featurep xemacs [(meta backspace)] [(meta delete)] [(meta right)] [(meta left)] [(control right)] [(control left)] [(control delete)] [M-right] [M-left] [C-right] [C-left] [C-delete] "" thai-xtis-backward-delete-char [backspace]] 4) (#$ . 967)) (byte-code "B!\"!B!\"!" [current-load-list thai-xtis-prev-auto-fill-function default-boundp set-default nil make-variable-buffer-local thai-xtis-prev-normal-auto-fill-function] 3) #@243 Minor mode for Thai text that pays attention to word segmentation. In this mode, word-oriented commands (e.g forward-word) and text filling commands (e.g. fill-paragraph) recognize Thai word boundaries within a sequence of Thai characters. (defalias 'thai-xtis-text-mode #[(&optional arg) "\n!! !\n !##! B!!!  !## " [thai-xtis-prev-normal-auto-fill-function thai-xtis-text-mode arg before-change-functions auto-fill-function thai-xtis-prev-auto-fill-function make-local-variable auto-fill-chars thai-xtis-do-auto-fill normal-auto-fill-function sentence-end-without-period t set-category-table copy-category-table put-charset-property thai-xtis fill-find-break-point-function thai-xtis-find-break-point nospace-between-words thai-xtis-wordseg-overlay-modification-function kill-local-variable standard-category-table nil force-mode-line-update] 5 (#$ . 1811) (list (not thai-xtis-text-mode))]) (byte-code "!%!##Ƈ" [thai-xtis-text-mode-map featurep xemacs add-minor-mode thai-xtis-text-mode " ThaiText" nil require alist set-alist minor-mode-alist (" ThaiText") minor-mode-map-alist] 6) #@143 *Program name of Thai word segmentor. This program reads a Thai word from stdin, and writes segmented words (separated by a space) to stdout. (defvar thai-xtis-wordseg-program "/usr/local/bin/wordseg" (#$ . -3000)) #@57 *Directory of data used by `thai-xtis-wordseg-program'. (defvar thai-xtis-wordseg-data "/usr/local/lib/wordseg" (#$ . -3221)) #@64 List of arguments for the program `thai-xtis-wordseg-program'. (defvar thai-xtis-wordseg-args (list "mule" "-d" thai-xtis-wordseg-data) (#$ . 3353)) #@185 Service name of port number for Thai word segmentor network service. If a program specified in `thai-xtis-wordseg-program' is not available on your machine, this service will be used. (defconst thai-xtis-wordseg-service 6750 (#$ . 3509)) #@53 *Host name for Thai word segmentor network service. (defvar thai-xtis-wordseg-server "localhost" (#$ . -3753)) #@69 Coding system used to communicate with `thai-xtis-wordseg-program'. (defvar thai-xtis-wordseg-coding-system 'tis-620 (#$ . 3870)) (byte-code "B!\"B!\"B!\"ć" [current-load-list thai-xtis-wordseg-proc default-boundp set-default nil thai-xtis-wordseg-buf thai-xtis-wordseg-ready] 3) (defalias 'thai-xtis-wordseg-filter #[(proc str) "\n P\n\"ʼn" [thai-xtis-wordseg-ready str thai-xtis-wordseg-buf string-match "\n" t] 3]) #@242 Segment STR by Thai words. Return a list of word starting positions. The last element of the list is the ending position of the last word. If optional arg STRINGP is non-nil, return a string of words in Thai separated by `|' (vertical bar). (defalias 'thai-xtis-word-segment #[(str &optional stringp) " %ǎ !&sʉ'(!)%*+$ !s\" ! \"\"*$ ,\"P\"$ !v -\". O؉C # Z\nB T Ti\n++" [thai-xtis-wordseg-program count segments thai-xtis-wordseg-buf idx thai-xtis-wordseg-proc match-data ((store-match-data #1=#:match-data)) process-status (run open) binary file-executable-p apply start-process "wordseg" nil open-network-stream (run open) error "Failed to run %s" process-kill-without-query set-process-filter thai-xtis-wordseg-filter sit-for 0 300 "" process-send-string encode-coding-string tis-620 "\n" accept-process-output decode-coding-string -2 string-match "|" thai-xtis-wordseg-ready #1# status coding-system-for-write coding-system-for-read thai-xtis-wordseg-args thai-xtis-wordseg-server thai-xtis-wordseg-service str thai-xtis-wordseg-coding-system stringp] 7 (#$ . 4336)]) (defalias 'thai-xtis-delete-wordseg-overlay #[(from to) " \"\n@\"\n@!\nAn)" [to from overlays overlays-in overlay-get thai-xtis-wordseg delete-overlay nil] 4]) (defalias 'thai-xtis-wordseg-overlay-modification-function #[(from to) " !!\"\n@\"\n@!\nAn)" [to from overlays append overlays-at overlay-get thai-xtis-wordseg delete-overlay nil] 5]) (defalias 'thai-xtis-get-wordseg-overlay #[(pos) "!\n\n@\"v\n@ĉq *" [pos overlay overlays overlays-at nil overlay-get thai-xtis-wordseg] 4]) (defalias 'thai-xtis-put-wordseg-overlay #[(from to segments) "\n \" # # )" [segments to from overlay make-overlay overlay-put thai-xtis-wordseg evaporate t] 4]) (defalias 'thai-xtis-set-wordseg-info-region #[(from to) " \" Ȏ bPˉ\n#͔` W!! dW T #V." [regexp to continue segments from end thai-xtis-delete-wordseg-overlay match-data ((store-match-data #1=#:match-data)) "+" t nil re-search-forward 0 thai-xtis-word-segment match-string thai-xtis-put-wordseg-overlay #1# thai-xtis-char-regexp] 5]) (defalias 'thai-xtis-wordsegs-at #[(pos) "\n!oh!auq`\n\"\n!) ! \" \"*)" [head segments pos overlay thai-xtis-get-wordseg-overlay char-charset thai-xtis -1 thai-xtis-set-wordseg-info-region overlay-start overlay-get thai-xtis-wordseg mapcar #[(x) " \\" [x head] 2]] 5]) (defalias 'thai-xtis-wordseg-info #[(pos) " ! \n!@W\n@\n@ X\n@\nAr\n@)B)" [from pos segments thai-xtis-wordsegs-at last] 4]) (defalias 'thai-xtis-search-next-wordseg #[(limit &optional inhibit-limit) " ǎ` V #u! #! `!ȉu\"!Օ`u\" W #`T`\")`!* W@u @`W @ Ar @`X Au @\nb+ b," [segments result pos orig limit l match-data ((store-match-data #1=#:match-data)) nil re-search-forward "\\sw" move -1 looking-at t re-search-backward thai-xtis-wordsegs-at 1 format "\\c%c+" ?t 0 "\\C%c" thai-xtis-set-wordseg-info-region to from thai-xtis-char-regexp #1#] 5]) (defalias 'thai-xtis-find-break-point #[(limit) "\n !!" [limit thai-xtis-char-regexp thai-xtis-text-mode looking-at thai-xtis-search-next-wordseg] 2]) #@312 How many columns right of `fill-column' auto filling should be delayed. In Auto Fill mode, when you type a Thai character beyond fill-column plus this value, automatic line-wrapping happens. This delay of automatic line-wrapping is to get more accurate word segmentation info from `thai-xtis-wordseg-program'. (defvar thai-xtis-auto-fill-delay-column 8 (#$ . 7742)) #@65 Substitution for the function `do-auto-fill' in Thai Text mode. (defalias 'thai-xtis-do-auto-fill #[nil "hs?i \\W? " [thai-xtis-auto-fill-delay-column fill-column (?\ ?\n ?\t) do-auto-fill] 3 (#$ . 8115)]) #@70 Substitution for the command `forward-word' in Thai Text minor mode. (defalias 'thai-xtis-forward-word #[(arg) " Vm!!unm?!d!v S! Wou!!pn?!ue!uv T!" [thai-xtis-char-regexp arg 0 looking-at "\\w" 1 thai-xtis-search-next-wordseg thai-xtis-forward-word -1] 2 (#$ . 8336) "p"]) #@71 Substitution for the command `backward-word' in Thai Text minor mode. (defalias 'thai-xtis-backward-word #[(arg) "[!" [arg thai-xtis-forward-word] 2 (#$ . 8677) "p"]) #@67 Substitution for the command `kill-word' in Thai Text minor mode. (defalias 'thai-xtis-kill-word #[(arg) "`! `\")" [arg pos thai-xtis-forward-word kill-region] 3 (#$ . 8853) "*p"]) #@76 Substitution for the command `backward-kill-word' in Thai Text minor mode. (defalias 'thai-xtis-backward-kill-word #[(arg) "[!" [arg thai-xtis-kill-word] 2 (#$ . 9046) "*p"]) #@73 Substitution for the command `transpose-words' in Thai Text minor mode. (defalias 'thai-xtis-transpose-words #[(arg) "\"" [arg transpose-subr thai-xtis-forward-word] 3 (#$ . 9230) "*p"]) (defalias 'thai-xtis-char-tone #[(char) "!\"" [char logand char-int 7] 3]) (byte-code "Ns\"#" [thai-xtis-char-tone byte-optimizer (nil byte-compile-inline-expand) error "%s already has a byte-optimizer, can't make it inline" put byte-compile-inline-expand] 4) (defalias 'thai-xtis-clear-char-tone #[(char) "!\"\"!" [char int-char logxor logior char-int 7] 5]) (byte-code "Ns\"#" [thai-xtis-clear-char-tone byte-optimizer (nil byte-compile-inline-expand) error "%s already has a byte-optimizer, can't make it inline" put byte-compile-inline-expand] 4) (defalias 'thai-xtis-char-verbal #[(char) "!\"" [char logand char-int 120] 3]) (byte-code "Ns\"#" [thai-xtis-char-verbal byte-optimizer (nil byte-compile-inline-expand) error "%s already has a byte-optimizer, can't make it inline" put byte-compile-inline-expand] 4) (defalias 'thai-xtis-clear-char-verbal #[(char) "!\"\"\"!" [char int-char logior logxor char-int 120 48] 6]) (byte-code "Ns\"#" [thai-xtis-clear-char-verbal byte-optimizer (nil byte-compile-inline-expand) error "%s already has a byte-optimizer, can't make it inline" put byte-compile-inline-expand] 4) #@119 Delete backward one character each, used in Thai text only. A vowel sign or a tone mark is considered as a character. (defalias 'thai-xtis-backward-delete-char #[(arg) "\nV`Sf !a  !\")V  !\"\"!)  !\")V  !\"\"\"!)))! c!)\nS" [verbal tone arg char chr 0 char-charset thai-xtis logand char-int 7 int-char logxor logior 120 48 backward-delete-char 1] 7 (#$ . 10631) "p"]) (provide 'thai-xtis-util)