[uim-commit] r821 - branches/composer/scm

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Apr 6 22:59:10 PDT 2005


Author: yamaken
Date: 2005-04-06 22:59:07 -0700 (Wed, 06 Apr 2005)
New Revision: 821

Modified:
   branches/composer/scm/ng-japanese-romaji.scm
Log:
* scm/ng-japanese-romaji.scm
  - (ja-romaji-generate-double-consonant-ruleset): Simplify and Optimize


Modified: branches/composer/scm/ng-japanese-romaji.scm
===================================================================
--- branches/composer/scm/ng-japanese-romaji.scm	2005-04-07 05:04:52 UTC (rev 820)
+++ branches/composer/scm/ng-japanese-romaji.scm	2005-04-07 05:59:07 UTC (rev 821)
@@ -57,24 +57,22 @@
 
 (define ja-romaji-generate-double-consonant-ruleset
   (lambda (romaji-ruleset)
-    (append-map (lambda (entry)
-		  (let ((letter (car entry))
-			(kana (cdr entry)))
-		    (filter-map (lambda (rule)
-				  (let* ((seq (evmap-rule-event-seq rule))
-					 (res (evmap-rule-action-seq rule))
-					 (listified (map (lambda (elem)
-							   (if (pair? elem)
-							       elem
-							       (list elem)))
-							 res)))
-				    (and (string? (car seq))
-					 (string=? letter
-						   (car seq))
-					 (list (cons letter seq)
-					       (map cons kana listified)))))
-				romaji-ruleset)))
-		ja-romaji-double-consonant-alist)))
+    (filter-map (lambda (rule)
+		  (let* ((seq (evmap-rule-event-seq rule))
+			 (entry (assoc (car seq)
+				       ja-romaji-double-consonant-alist)))
+		    (and entry
+			 (let* ((res (evmap-rule-action-seq rule))
+				(listified (map (lambda (elem)
+						  (if (pair? elem)
+						      elem
+						      (list elem)))
+						res))
+				(letter (car entry))
+				(kana (cdr entry)))
+			   (list (cons letter seq)
+				 (map cons kana listified))))))
+		romaji-ruleset)))
 
 (define ja-romaji-double-consonant-guide-ruleset
   (map (lambda (entry)



More information about the Uim-commit mailing list