From: yamagami@hb.nmcc.co.jp (Yoshiyuki Yamagami)
Newsgroups: fj.rec.sports.keiba
Subject: tipster.el
Date: 14 Apr 92 09:14:05 GMT
Distribution: fj
Organization: Nihon Micro Computer Corp.,Osaka Japan


$@$d$^$,$_!w#N#M$G$9!#(J

$tipster$$@$r;H$C$FGOCl$r:n$k$?$a$N#e#l#i#s#p$N%3!<%I$G$9!#(J
$@!%#e#m#a#c#s$K$$$l$k$J$j$7$F;H$C$F$/$@$5$$!#(J

BEGIN---$@$3$3$+$i(J----------------------------------------

;;  tipster.el ver 0.51
;;  1991/12/14
;;  Originally Programmed by Y.Yamagami
;;  ver 0.51 1992/04/06
;;
;; JUNET DERBY $@$GEjI<$5$l$?5-;v$+$i(J
;; $@!}%$%V%-%^%$%+%0%i(J
;; $@!{%l%*%@!<%P%s(J
;; $@$H$$$&$h$&$JJ8;zNs$rA\$7=P$7$F!"!J9T$N@hF,$K0u$,$"$k>l9g!K(J
;; $@GOCl$r:n$j$^$9(J
;;
;; $@0J2<$N$h$&$J%j%9%H$,F~$C$?%U%!%$%k$r:n$C$F$*$-$^$9!#2>$K(J arima.el
;;
;; (setq JD-HorseName-list
;;       '(
;;         ("$@%$%V%-%^%$%+%0%i(J"   "$@%$%V%-%^%$%+%0%i(J  " "$@Fn(J  $@0f(J" "$@#5#5(J")
;;         ("$@%*%5%$%A%8%g!<%8(J"   "$@%*%5%$%A%8%g!<%8(J  " "$@4](J  $@;3(J" "$@#5#6(J")
;;           .
;;           .
;;           .
;;           .
;;         ("$@%l%*%@!<%P%s(J"       "$@%l%*%@!<%P%s(J      " "$@2,(J  $@It(J" "$@#5#5(J")
;;         ("$@%*!<%9%_%7%c%@%$(J"   "$@%*!<%9%_%7%c%@%$(J  " "$@!{(J  $@!{(J" "$@#5#6(J")
;; ))
;;
;; $@EjI<$5$l$?5-;v$r$^$H$a$FJ]B8$7$F$*$-$^$9!#2>$K(J arima.txt
;;
;; arima.txt$@$rFI$_9~$s$G!"$=$N%P%C%U%!$G(J
;; M-x jd-tipsters
;; $@$H$7$F!"%U%!%$%kL>$rJ9$$$F$/$k$N$G(J arima.el$@$r;XDj$7$^$9!#$9$k$H(J
;; *JUNET DERBY HorseName Pillar*$@$H$$$&%P%C%U%!$KGOCl$,:n$i$l$^$9!#(J
;;
;; $@5-;v$NJ}$G$OC/$NEjI<$+J,$+$k$h$&$K5-;v$N@hF,$K(J
;; $tipster$ $@!_!_$N!{!{(J
;; $@$H$$$&$h$&$J9T$r$$$l$F$*$$$F$b$i$$$^$9!#(J
;;
;;

(defvar JD-sirusi (list '"$@!}(J"
			'"$@!{(J"
			'"$@"%(J"
			'"$@"$(J"
			'"$@!_(J"
			'"$@!'(J"
			'"$@Hr(J"
			'"$@Cm(J"))
(defvar *JD-tipster-mark* '"$tipster$")
(defconst *Pillar-window* "*JUNET DERBY HorseName Pillar*")
(defconst *Tipters-window* "*JUNET DERBY Tipster*")

(defun jd-tipsters (load-file)
  (interactive (list (read-file-name "JD-Tipsters File Name: "
				     nil default-directory nil)))
  (let* ((tipster-buffer (tipsters))
	 (pillar-buffer  (horsename-pillar load-file tipster-buffer))
	 (sbuffer (current-buffer)))
;;; tipster-buffer : $@M=A[20$N0u0lMw$N(Jbuffer
;;; pillar-buffer  : $@GOCl$N(Jbuffer
;;; sbuffer        : $@%+%l%s%H!JJ]B85-;v!K(Jbuffer

    (set-buffer pillar-buffer)
    (beginning-of-buffer)
    (set-buffer tipster-buffer)
    (beginning-of-buffer)
    (set-buffer sbuffer)
    (kill-buffer tipster-buffer)  ; 1992/04/06 by Y.Yamagami
    ))

(defun horsename-pillar (loadfile t-buffer)
  (load loadfile)
  (let ((horse-name-list JD-HorseName-list)
	(cbuffer (current-buffer))
	(oput-buffer (get-buffer-create *Pillar-window*))
	(count 0))
;;; t-buffer        : $@M=A[20$N0u0lMw$N(Jbuffer
;;; horse-name-list : $@=PAvEPO?GO$N0lMw%j%9%H(J
;;; cbuffer        : $@%+%l%s%H!JJ]B85-;v!K(Jbuffer
;;; oput-buffer    : $@GOCl$N(Jbuffer
;;; count          : $@>e$+$i2?F,L\$+(J(0,1,2...)
    (set-window-start (display-buffer oput-buffer) 1)
    
;;; oput-buffer
    (set-buffer oput-buffer)
    (while (not (null horse-name-list))
      (let ((h-name (car horse-name-list)))   ;;; h-name : $@GO$NL>A0(J
;;; t-buffer
	(set-buffer t-buffer)
	(beginning-of-buffer)
	(setq t-name (search-tipster-mark))   ;;; t-name : $@M=A[20$NL>A0(J
	(setq t-buffer-sp (point))
	(while (not (null t-name))
	  (if (zerop count)
	      (progn
;;; oput-buffer
		(set-buffer oput-buffer)
		(beginning-of-buffer)
		(end-of-line)
		(setq bpoint (point))
		(insert t-name)
		(let ((countx 5)
		      (apoint (point)))
		  (while (not (zerop countx))
		    (goto-char bpoint)
		    (forward-char 1)
		    (setq cpoint (point))
		    (setq t-name-sub (buffer-substring apoint cpoint))
		    (kill-region apoint cpoint)
		    (next-line 1)
		    (setq bpoint (point))
		    (insert t-name-sub)
		    (setq apoint (point))
		    (setq countx (- countx 1))))
;		(next-line 1)
		)
;;; oput-buffer
	    (set-buffer oput-buffer)
	    (beginning-of-buffer)
	    (end-of-buffer))
;;; t-buffer
	  (set-buffer t-buffer)
	  (setq t-name (search-tipster-mark))
	  (if (null t-name)
	      (end-of-buffer)
	    (search-backward *JD-tipster-mark* nil t))
	  (setq t-buffer-ep (point))
	  (setq o-sirusi (get-tipster-sirusi t-buffer-sp t-buffer-ep h-name))
;;; oput-buffer
	  (set-buffer oput-buffer)
	  (insert o-sirusi)
;;; t-buffer
	  (set-buffer t-buffer)
	  (goto-char t-buffer-ep)
	  (if (not (null t-name))
	      (forward-char 1))
	  (setq t-buffer-sp (point))
	  )
;;; oput-buffer
	(set-buffer oput-buffer)
	(disp-one-line h-name)
	(setq count (+ count 1))
	(setq horse-name-list (cdr horse-name-list))))
;;; cbuffer
    (set-buffer cbuffer)
    cbuffer))

(defun get-tipster-sirusi (tst ted hn-list)
  (let ((hn (car hn-list)))
    (save-restriction
      (narrow-to-region tst ted)
      (goto-char tst)
      (if (null (search-forward hn nil t))
	  (car (cdr (cdr (cdr (cdr (cdr JD-sirusi))))))
	(beginning-of-line)
	(setq spoint (point))
	(forward-char 1)
	(buffer-substring spoint (point))))))
	  
(defun disp-one-line ( Jobj )
    (insert (car (cdr Jobj)))
    (insert "  ")
    (insert (car (cdr (cdr Jobj))))
    (insert "  ")
    (insert (car (cdr (cdr (cdr Jobj)))))
    (insert "\n"))

(defun tipsters ()
  (interactive)
  (let ((ooopint (point))
	(oput-buffer (get-buffer-create *Tipters-window*)))
    (while (not (null (search-forward *JD-tipster-mark* nil t)))
      (backward-word 1)
      (backward-char 1)
      (setq st (point))
      (forward-char 1)
      (forward-word 1)
      (if (null (search-forward *JD-tipster-mark* nil t))
	  (end-of-buffer))
      (setq ed (point))
      (one-tipster st ed oput-buffer)
      (goto-char ed)
      (backward-word 1)
      (backward-char 1))
    oput-buffer))

(defun one-tipster (start end outbuffer)
  (save-restriction
    (narrow-to-region start end)
    (goto-char start)
    (let ((obuffer (current-buffer))
	  (sirusi  JD-sirusi)
	  (tipster-name (search-tipster-mark)))
      (goto-char start)
      (set-window-start (display-buffer outbuffer) 1)
      (set-buffer outbuffer)
      (insert "\n")
      (insert *JD-tipster-mark*)
      (insert "\n")
      (insert tipster-name)
      (insert "\n")
      (set-buffer obuffer)
      (while (not (null sirusi))
	(while (search-sirusi (car sirusi))
	  (if (check-sirusi)
	      (progn
		(set-buffer outbuffer)
		(insert (car sirusi))
		(set-buffer obuffer)
		(setq hname (ttoken))
		(set-buffer outbuffer)
		(insert hname)
		(insert "\n")
		(set-buffer obuffer))))
	(goto-char start)
	(setq sirusi (cdr sirusi))))))


(defun search-tipster-mark ()
  (if (null (search-forward *JD-tipster-mark* nil t))
      'nil
    (tget-next-char)
    (ttoken)))

(defun search-sirusi ( sirusi )
  (if (null sirusi)
      'nil
    (search-forward sirusi nil t)))

(defun check-sirusi ()
  (setq tmpoint (point))
  (backward-char)
  (backward-char)
  (setq tn (= (char-after (point)) 10))
  (goto-char tmpoint)
  tn)

(defun ttoken nil
  (setq opoint (point))
  (while (not (memq (tget-next-char) '(9 10 32))))
  (backward-char)
  (buffer-substring opoint (point)))

(defun tget-next-char nil
  (prog1 (char-after (point)) (forward-char)))

END---$@$3$3$^$G(J--------------------------------------------------
--
Yoshiyuki Yamagami ( yamagami@hb.nmcc.co.jp )