[logaling-commit] logaling/logalimacs [master] Move regexp for singular form function

Back to archive index

null+****@clear***** null+****@clear*****
Sun Jul 22 22:42:06 JST 2012


Yuta Yamada	2012-07-22 22:42:06 +0900 (Sun, 22 Jul 2012)

  New Revision: 07cee07dea00deea42b78184853ee1fc9a9d03d6
  https://github.com/logaling/logalimacs/commit/07cee07dea00deea42b78184853ee1fc9a9d03d6

  Log:
    Move regexp for singular form function

  Modified files:
    logalimacs.el

  Modified: logalimacs.el (+11 -9)
===================================================================
--- logalimacs.el    2012-07-22 22:07:19 +0900 (de7227f)
+++ logalimacs.el    2012-07-22 22:42:06 +0900 (714bc9a)
@@ -140,6 +140,16 @@ Example:
 
 (defvar loga-prototype-word "")
 
+(defconst loga-singular-regexp '(("ies$" "y")
+                                 ("[^t][^i]ves$" "f") ; fe
+                                 ("ses$"  "s")
+                                 ("oes$"  "o")
+                                 ("xes$"  "x")
+                                 ("sses$" "ss")
+                                 ("shes$" "sh")
+                                 ("ches$" "ch")
+                                 ("s$"    "")))
+
 (defvar loga-command-alist
   '((?a . :add)
     (?c . :config)
@@ -541,15 +551,7 @@ Otherwise passed character inside region."
 
 (defun loga-to-singular-form (word)
   (if loga-use-singular-form
-      (loop for (regexp replace) in '(("ies$" "y")
-                                      ("[^t][^i]ves$" "f") ; fe
-                                      ("ses$"  "s")
-                                      ("oes$"  "o")
-                                      ("xes$"  "x")
-                                      ("sses$" "ss")
-                                      ("shes$" "sh")
-                                      ("ches$" "ch")
-                                      ("s$"   ""))
+      (loop for (regexp replace) in loga-singular-regexp
             for singular-word = word then singular-word
             do (setq singular-word
                      (replace-regexp-in-string regexp replace singular-word))
-------------- next part --------------
An HTML attachment was scrubbed...
Télécharger 



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