[logaling-commit] logaling/logalimacs [master] Collect conditions for stemming

Back to archive index

null+****@clear***** null+****@clear*****
Sat Jul 21 14:36:55 JST 2012


Yuta Yamada	2012-07-21 14:36:55 +0900 (Sat, 21 Jul 2012)

  New Revision: e89590745cd8749b8082de1fc4f971614c4588b6
  https://github.com/logaling/logalimacs/commit/e89590745cd8749b8082de1fc4f971614c4588b6

  Log:
    Collect conditions for stemming

  Modified files:
    logalimacs.el

  Modified: logalimacs.el (+7 -4)
===================================================================
--- logalimacs.el    2012-07-21 14:20:31 +0900 (1ea6bc9)
+++ logalimacs.el    2012-07-21 14:36:55 +0900 (928ddf2)
@@ -310,9 +310,7 @@ Example:
           (:popup  (loga-make-popup
                     (loga-ignore-login-message terminal-output)))
           (:buffer (loga-make-buffer terminal-output)))
-      (if (and loga-use-stemming
-               (not striped-source-word)
-               (loga-one-word-p source-word))
+      (if (loga-fallback-with-stemming-p source-word striped-source-word)
           (loga-lookup endpoint (loga-extract-prototype-from source-word))
         (if (functionp loga-fallback-function)
             (loga-fallback (caar loga-word-cache))
@@ -427,6 +425,12 @@ Example:
         (below-limit-p (< source-length loga-width-limit-source)))
     (and more-than-max-p less-than-window-half-p below-limit-p)))
 
+(defun loga-fallback-with-stemming-p (source-word striped-source-word)
+  (and loga-use-stemming
+       (not striped-source-word)
+       (loga-one-word-p source-word)
+       (ignore-errors (require 'stem nil t))))
+
 (defun loga-less-than-window-half-p (source-length)
   (let* ((half (- (/ (window-width) 2) 2)))
     (< source-length half)))
@@ -688,7 +692,6 @@ Otherwise passed character inside region."
 
 ;; TODO: pull request stem.el to MELPA
 (defun loga-extract-prototype-from (source-word)
-  (require 'stem nil t)
   (stem:stripping-inflection source-word))
 
 (provide 'logalimacs)
-------------- next part --------------
An HTML attachment was scrubbed...
Descargar 



More information about the logaling-commit mailing list
Back to archive index