Revision: 6432
Author: ek.kato
Date: Thu Jun 10 01:08:45 2010
Log: * scm/ct.scm
  - (ct-lib-expect-key-for-seq?) : New.  Implements equivalent
    function in rk.c.
  - (ct-lib-expect-seq) : Ditto.

http://code.google.com/p/uim/source/detail?r=6432

Modified:
 /trunk/scm/ct.scm

=======================================
--- /trunk/scm/ct.scm   Thu Jun 10 00:59:09 2010
+++ /trunk/scm/ct.scm   Thu Jun 10 01:08:45 2010
@@ -91,3 +91,23 @@
             (else
               #f)))
         #f))))
+
+(define ct-lib-expect-key-for-seq?
+  (lambda (seq table str)
+    (let* ((lst (ct-find-cands-with-minimal-partial seq table))
+           (residuals
+             (filter-map (lambda (x) (if (string=? (cdr x) "")
+                                       #f
+                                       (substring (cdr x) 0 1))) lst)))
+      (if (member str residuals)
+        #t
+        #f))))
+
+(define ct-lib-expect-seq
+  (lambda (seq table keystr)
+    (let* ((lst (ct-find-cands-with-minimal-partial seq table))
+           (residuals
+             (filter-map (lambda (x) (if (string=? (cdr x) "")
+                                       #f
+                                       (substring (cdr x) 0 1))) lst)))
+    residuals)))

Reply via email to