Changeset 74 for lang/elisp/pdicv-mode

Show
Ignore:
Timestamp:
01/31/09 00:20:29 (15 years ago)
Author:
naoya_t
Message:

modified around entry word tabsep

Location:
lang/elisp/pdicv-mode/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/elisp/pdicv-mode/trunk/pdicv-core.el

    r71 r74  
    215215 
    216216         (32bit-address-mode (if (= (-> header 'index-blkbit) 32) t nil)) 
    217                  (tab-sep-p (if (eq 'unicode-bocu-6 (-> header 'version)) t nil)) 
     217                 (tab-sep-p (eq 'unicode-bocu-6 (-> header 'version))) 
    218218 
    219219         (ix 0) (ix-max (-> header 'nindex)) 
     
    297297    (let* ((result ()) ;(match-count 0) 
    298298           (header (pdicv-get-header-info filename)) 
     299                   (tab-sep-p (eq 'unicode-bocu-6 (-> header 'version))) 
    299300                   (block-size (-> header 'block-size)) 
    300301           (offset (+ (-> header 'datablock-begins-at) (* phys block-size))) 
     
    340341                        (concat (substring eword 0 compress-length) eword-compressed) )) 
    341342          (setq q (1+ eword-len)) 
    342                                         ; �����В�������� 
     343                  ;; �����В�������� 
    343344          (when (not aligned) 
    344345                        (setq eword-attrib (nt:read-uchar rest q)) 
     
    384385            ) ; if extended 
    385386 
    386                                         ;         (insert (format "- %s\n" eword)) 
    387           (when (funcall criteria-func eword pron jword example) 
    388                         (push (list eword pron jword example) result)) 
     387                  (if tab-sep-p 
     388                          (let* ((splitted (split-string eword "\t")) 
     389                                         (eword (car splitted)) 
     390                                         (entry (cadr splitted))) 
     391                                (when (funcall criteria-func entry eword pron jword example) 
     392                                  (push (list entry pron jword example) result))) 
     393                        (when (funcall criteria-func eword eword pron jword example) 
     394                          (push (list eword pron jword example) result))) 
     395                  ;;(when (funcall criteria-func eword pron jword example) 
     396                  ;;    (push (list eword pron jword example) result)) 
    389397          );let 
    390398        ); wend 
  • lang/elisp/pdicv-mode/trunk/pdicv-search.el

    r71 r74  
    6060                (message "Loading index-table for %s (\"%s\")..." dicname path) 
    6161                (setq index-table (pdicv-get-index-list path word-encoding)) 
    62                 (push (cons dicname index-table) pdicv-index-table-list)) 
    63             );fi 
    64           );let* 
    65         (setq diclist (cdr diclist)) 
    66         );wend 
     62                (push (cons dicname index-table) pdicv-index-table-list)) )) 
     63        (setq diclist (cdr diclist))) 
    6764      (setq pdicv-inited-p t) 
    68       (message "Done.") 
    69       ); let 
    70     );caught 
    71   ) 
     65      (message "Done.") ))) 
    7266 
    7367(defun pdicv-search-regexp (dicname regexp-to-search &optional field-to-search) 
     
    137131;                                               (string-match needle1 word))) 
    138132;                               ) 
    139                                 `(lambda (e p j x) (string-match ,needle1 ,field-to-search)) 
     133                                `(lambda (e_ e p j x) (string-match ,needle1 ,field-to-search)) 
    140134                                );list 
    141135                    (list 
     
    144138                                       ;                                        (string< word needle2)))) 
    145139                     (if just-p 
    146                          `(lambda (e p j x) (zerop (nt:strcmp ,field-to-search ,needle1))) 
    147                        `(lambda (e p j x) (and (not (string< ,field-to-search ,needle1)) 
    148                                                (string< ,field-to-search ,needle2))) ; �ǡ����֥�������� 
    149                        );just-p 
    150                      );list 
    151                     ));fi,criteria 
    152  
    153                  );let* 
     140                         `(lambda (e_ e p j x) (zerop (nt:strcmp ,field-to-search ,needle1))) 
     141                       `(lambda (e_ e p j x) (and (not (string< ,field-to-search ,needle1)) 
     142                                                                                                  (string< ,field-to-search ,needle2))) ; �ǡ����֥�������� 
     143                       ))))) 
    154144                                        ;         (insert (format "%s" criteria)) 
    155145            (pdicv-core-search dicinfo criteria simple-mode-p (not first-round-p)) ; clear only at the first time 
    156             );let* 
    157           );fi 
    158         (setq first-round-p nil) 
    159         );wend 
    160       );let 
    161     );caught 
    162   ) 
    163  ;;debug 
     146            )) 
     147        (setq first-round-p nil))))) 
    164148 
    165149(defun pdicv-search-interactive () 
     
    174158            (read-from-minibuffer "Word to search: ")) 
    175159      (if (> (length word-to-search) 0) 
    176           (pdicv-search (intern dicname) word-to-search)) 
    177       );let 
    178     );caught 
    179   ) 
    180  
     160          (pdicv-search (intern dicname) word-to-search)) ))) 
    181161 
    182162(defun pdicv-search-region (from to) 
     
    184164  (interactive "r") 
    185165  (let ((dicname (completing-read "Target dictionary: " pdicv-dictionary-list nil t ""))) 
    186     (if dicname (pdicv-search (intern dicname) (buffer-substring from to))) 
    187     );let 
    188   ) 
     166    (if dicname (pdicv-search (intern dicname) (buffer-substring from to))) )) 
    189167 
    190168(defun pdicv-set-target-dictionary () 
     
    192170  (interactive) 
    193171  (let ((dicname (completing-read "Target dictionary: " pdicv-dictionary-list nil t ""))) 
    194     (if dicname (setq pdicv-target-dictionary (intern dicname))) 
    195     );let 
    196   ) 
     172    (if dicname (setq pdicv-target-dictionary (intern dicname))) )) 
    197173 
    198174(defun pdicv-search-current-word () 
     
    204180    (if word;(and word (not (nt:skipit-p word-to-search))) 
    205181        (pdicv-search-just pdicv-target-dictionary word) 
    206       (message "no word at cursor")) 
    207     );let 
    208   ) 
     182      (message "no word at cursor")) )) 
    209183 
    210184(defun pdicv-search-next-word () 
     
    224198        (if (and word (not (nt:skipit-p word))) 
    225199            (pdicv-search-just pdicv-target-dictionary word) 
    226           (message "no word at cursor"));fi 
    227         );progn 
    228       );fi 
    229     );let 
    230   ) 
     200          (message "no word at cursor")) )))) 
    231201 
    232202(defun pdicv-search-previous-word () 
     
    234204  (interactive) 
    235205  (forward-word -1) ; (backward-word 1) 
    236   (pdicv-search-current-word) 
    237   ) 
     206  (pdicv-search-current-word)) 
    238207 
    239208;;; pdicv-search.el ends here