[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: lookup の動画対応



From: Hideyuki SHIRAI (白井秀行) <shirai@xxxxxxxxxxx> 曰く
Subject: Re: lookup の動画対応
Message-ID: <20060627.224733.78214120.shirai.hideyuki@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 Jun 2006 22:47:33 +0900 (JST)

> > パッチの統合はしばしお待ち下さい。
> 
> なにか気に入らない点や改造したい点がありましたらご自由にどうぞ。

手元では直しておいたのですが、パッチに反映するのをひとつ忘れてし
まいました。これもお願いします (__)

ひとつの辞書で複数のエントリがヒットするときに、

% eblook /..../mypaedia
eblook> select 1
eblook> search ライオン
 1. 14545:730   ライオン
 2. 14545:1732  ライオン
 3. 14545:730   ライオン
 4. 14545:1732  ライオン
eblook>

な感じで重複するときがあるので、その対処です。

2006-06-28  Hideyuki SHIRAI  <shirai@xxxxxxxxxxx>

	* ndeb.el (ndeb-dictionary-search): Remove duplicated entry
	surely.

-- 
白井秀行 (mailto:shirai@xxxxxxxxxxx)
--- ndeb.el.2   2006-06-27 11:03:48.000000000 +0900
+++ ndeb.el     2006-06-28 10:47:43.000000000 +0900
@@ -266,15 +266,14 @@
        (lookup-agent-put-property ndeb-current-agent 'ndeb-method method)))
     (ndeb-process-require (format "search \"%s\"" (lookup-query-string query))
       (lambda (process)
-       (let (code heading last-code last-heading entries)
+       (let (code heading entries dupchk)
          (while (re-search-forward "^[^.]+\\. \\([^\t]+\\)\t\\(.*\\)" nil t)
            (setq code (match-string 1) heading (match-string 2))
-           ;; 同じエントリが連続していないかチェックする。
+           ;; 同じエントリがあるかチェックする。
            ;; これがけっこうあるんだ・・
-           (when (or (not (string= code last-code))
-                     (not (string= heading last-heading)))
+           (unless (member (cons code heading) dupchk)
              (setq entries (cons (ndeb-make-entry code heading) entries))
-             (setq last-code code last-heading heading)))
+             (setq dupchk (cons (cons code heading) dupchk))))
          (nreverse entries))))))

 (put 'ndeb 'content 'ndeb-dictionary-content)