• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/language/

Lines Matching defs:word

1 ;;; thai-word.el -- find Thai word boundaries
9 ;; Keywords: thai, word break, emacs
26 ;; The used Thai word list has been taken from IBM's ICU4J project
68 ;; This file implements an algorithm to find Thai word breaks using a
77 (defvar thai-word-table
10740 (defun thai-update-word-table (file &optional append)
10741 "Update Thai word table by replacing the current word list with
10743 the current word list."
10744 (interactive "FThai word table file: \nP")
10747 (table (if append thai-word-table (list 'thai-words))))
10756 (setq thai-word-table table)))
10766 ;; the Thai word ends. It doesn't move point. LIMIT limits the
10771 ;; Note that the longest word position comes first.
10773 (defun thai-find-word-ends (pos limit &optional ignore)
10777 (this (cdr (assq char (cdr thai-word-table))))
10780 ;; Look up the following character sequence in `thai-word-table'
10786 ;; If the current sequence is recorded in `thai-word-table'
10789 ;; found a possible word ending position.
10807 ;; Move point forward to the end of Thai word which follows point and
10808 ;; update VEC. VEC is a vector of three elements used to cache word
10810 ;; points of the Nth word, or t indicating that there is no Thai
10813 (defun thai-forward-word-update-info (vec limit)
10827 (setq v0 (thai-find-word-ends pos limit))
10834 ;; OK, V0 holds possible word ends for the current position.
10838 ;; Now we try all end word positions to find the next word.
10846 ;; start(long-word) = start(short-word1)
10848 ;; end(short-word2) = end(long-word)
10850 ;; only long-word is used.
10851 (setq v1 (thai-find-word-ends pos limit tried))
10859 ;; longest first word followed by the longest second word.
10863 ;; Update the already tried end word positions.
10865 ;; Now repeat the whole process to find a third word.
10871 (setq v2 (thai-find-word-ends pos limit tried))
10876 ;; And the same for a fourth word.
10879 (setq v3 (thai-find-word-ends pos limit tried))
10889 ;; reached). Move to the end of the first word.
10891 ;; Update VEC for the next function call. If no larger word
10904 ;; longer than the longest word we can see at the current point,
10912 ;; We finally failed to find a word break. For Thai, the best
10913 ;; solution is to extend the first longest word so that the
10914 ;; end point starts a second word.
10917 (not (setq positions (thai-find-word-ends pos limit))))
10925 ;; Return a list of Thai word boundary positions after the current
10928 (defun thai-find-word-boundaries (&optional limit)
10942 ;; Check the first word, initializing VEC.
10943 (thai-forward-word-update-info vec this-limit)
10948 (thai-forward-word-update-info vec this-limit)))
10953 "Break Thai words by inserting a separator string at word boundaries."
10956 (let ((boundaries (thai-find-word-boundaries limit)))
10963 (defun thai-forward-word (count)
10964 "Move point forward COUNT words considering Thai word boundaries.
10972 ;; special instead of using forward-word.
10977 ;; If thai-forward-word has been called within a Thai
10979 ;; to do the contextual analysis for finding word
10983 ;; OK, we ask for the list of word boundaries in
10985 (setq boundaries (nreverse (thai-find-word-boundaries limit)))
10999 ;; If BOUNDARIES is empty, the word counter is not
11007 (forward-word 1)
11021 (setq boundaries (thai-find-word-boundaries limit))
11032 (forward-word -1)
11036 (defun thai-backward-word (count)
11037 "Move point backward COUNT words considering Thai word boundaries.
11040 (thai-forward-word (- count)))
11043 (defun thai-kill-word (arg)
11044 "Like kill-word but pay attention to Thai word boundaries.
11047 (kill-region (point) (progn (thai-forward-word arg) (point))))
11050 (defun thai-backward-kill-word (arg)
11051 "Like backward-kill-word but pay attention to Thai word boundaries."
11053 (thai-kill-word (- arg)))
11057 "Like transpose-words but pay attention to Thai word boundaries."
11059 (transpose-subr 'thai-forward-word arg))
11062 "Go to a line breaking position near point considering Thai word boundaries."
11064 (thai-forward-word -1)
11067 (thai-forward-word 1))
11070 (provide 'thai-word)
11077 ;; end of thai-word.el