diff bindings/sb-alien/interface.lisp @ 672:a35ca2d5f238

Extend results structure to include a key for the query. Fill that key from the query datum, if given, defaulting to ""; patch up bindings and tests. This is so that (Instance x Instance) operations such as querying and sampling can be supported.
author mas01cr
date Fri, 05 Mar 2010 16:00:53 +0000
parents 7e7ba87b5466
children e4eae1f59759
line wrap: on
line diff
--- a/bindings/sb-alien/interface.lisp	Fri Mar 05 16:00:49 2010 +0000
+++ b/bindings/sb-alien/interface.lisp	Fri Mar 05 16:00:53 2010 +0000
@@ -143,7 +143,8 @@
         datum))))
 
 (defstruct result
-  (key "" :type string)
+  (qkey "" :type string)
+  (ikey "" :type string)
   (distance 0d0 :type double-float)
   (qpos 0 :type (and unsigned-byte fixnum))
   (ipos 0 :type (and unsigned-byte fixnum)))
@@ -163,7 +164,7 @@
       (sequence:dosequence (r o)
         (pprint-pop)
         (format s "~A ~6,3e ~D ~D~@:_"
-                (result-key r) (result-distance r)
+                (result-ikey r) (result-distance r)
                 (result-qpos r) (result-ipos r))))))
       
 (defmethod sequence:length ((o copied-query-results))
@@ -298,7 +299,8 @@
                                   (loop for i below nresults
                                         for r = (deref cresults i)
                                         collect (make-result 
-                                                 :key (slot r 'key) 
+                                                 :ikey (slot r 'ikey) 
+                                                 :qkey (slot r 'qkey) 
                                                  :distance (slot r 'dist)
                                                  :qpos (slot r 'qpos) 
                                                  :ipos (slot r 'ipos)))