pike.git / src / modules / _WhiteFish / whitefish.c

version» Context lines:

pike.git/src/modules/_WhiteFish/whitefish.c:1:   #include <math.h>      #include "global.h"   #include "stralloc.h"   #include "global.h" - RCSID("$Id: whitefish.c,v 1.30 2001/06/15 02:12:28 per Exp $"); + RCSID("$Id: whitefish.c,v 1.31 2001/07/04 22:24:42 per Exp $");   #include "pike_macros.h"   #include "interpret.h"   #include "program.h"   #include "program_id.h"   #include "object.h"   #include "operators.h"   #include "array.h"   #include "module_support.h"      #include "config.h"
pike.git/src/modules/_WhiteFish/whitefish.c:370:    /* Free workarea and return the result. */       UNSET_ONERROR( e );    __f->res = 0;    free_stuff( __f );    return res;   }         static void f_do_query_phrase( INT32 args ) - /*! @decl ResultSet do_query_phrase( array(int) words, @ + /*! @decl ResultSet do_query_phrase( array(string) words, @    *! array(int) field_coefficients, @    *! function(int:string) blobfeeder)    *! @[words]    *!    *! Arrays of word ids. Note that the order is significant    *! for the ranking.    *!    *! @[field_coefficients]    *!    *! An array of ranking coefficients for the different fields.
pike.git/src/modules/_WhiteFish/whitefish.c:424:    {    struct object *o = wf_resultset_new( );    pop_n_elems( args );    wf_resultset_push( o );    return;    }       blobs = malloc( sizeof(Blob *) * numblobs );       for( i = 0; i<numblobs; i++ ) -  blobs[i] = wf_blob_new( cb, _words->item[i].u.integer ); +  blobs[i] = wf_blob_new( cb, _words->item[i].u.string );       for( i = 0; i<66; i++ )    field_coefficients[i] = (double)_field->item[i].u.integer;       res = low_do_query_phrase(blobs,numblobs, field_coefficients );    pop_n_elems( args );    wf_resultset_push( res );   }      static void f_do_query_and( INT32 args ) - /*! @decl ResultSet do_query_and( array(int) words, @ + /*! @decl ResultSet do_query_and( array(string) words, @    *! array(int) field_coefficients, @    *! array(int) proximity_coefficients, @    *! function(int:string) blobfeeder)    *! @[words]    *!    *! Arrays of word ids. Note that the order is significant    *! for the ranking.    *!    *! @[field_coefficients]    *!
pike.git/src/modules/_WhiteFish/whitefish.c:511:    {    struct object *o = wf_resultset_new( );    pop_n_elems( args );    wf_resultset_push( o );    return;    }       blobs = malloc( sizeof(Blob *) * numblobs );       for( i = 0; i<numblobs; i++ ) -  blobs[i] = wf_blob_new( cb, _words->item[i].u.integer ); +  blobs[i] = wf_blob_new( cb, _words->item[i].u.string );       for( i = 0; i<8; i++ )    proximity_coefficients[i] = (double)_prox->item[i].u.integer;       for( i = 0; i<66; i++ )    field_coefficients[i] = (double)_field->item[i].u.integer;       res = low_do_query_and(blobs,numblobs,    field_coefficients,    proximity_coefficients,    cutoff );    pop_n_elems( args );    wf_resultset_push( res );   }      static void f_do_query_or( INT32 args ) - /*! @decl ResultSet do_query_or( array(int) words, @ + /*! @decl ResultSet do_query_or( array(string) words, @    *! array(int) field_coefficients, @    *! array(int) proximity_coefficients, @    *! function(int:string) blobfeeder)    *! @[words]    *!    *! Arrays of word ids. Note that the order is significant    *! for the ranking.    *!    *! @[field_coefficients]    *!
pike.git/src/modules/_WhiteFish/whitefish.c:604:    {    struct object *o = wf_resultset_new( );    pop_n_elems( args );    wf_resultset_push( o );    return;    }       blobs = malloc( sizeof(Blob *) * numblobs );       for( i = 0; i<numblobs; i++ ) -  blobs[i] = wf_blob_new( cb, _words->item[i].u.integer ); +  blobs[i] = wf_blob_new( cb, _words->item[i].u.string );       for( i = 0; i<8; i++ )    proximity_coefficients[i] = (double)_prox->item[i].u.integer;       for( i = 0; i<66; i++ )    field_coefficients[i] = (double)_field->item[i].u.integer;       res = low_do_query_or(blobs,numblobs,    field_coefficients,    proximity_coefficients,
pike.git/src/modules/_WhiteFish/whitefish.c:629:         void pike_module_init(void)   {    init_resultset_program();    init_blob_program();    init_blobs_program();    init_linkfarm_program();       add_function( "do_query_or", f_do_query_or, -  "function(array(int),array(int),array(int),int" -  ",function(int:string):object)", +  "function(array(string),array(int),array(int),int" +  ",function(string,int:string):object)",    0 );       add_function( "do_query_and", f_do_query_and, -  "function(array(int),array(int),array(int),int" -  ",function(int:string):object)", +  "function(array(string),array(int),array(int),int" +  ",function(string,int:string):object)",    0 );       add_function( "do_query_phrase", f_do_query_phrase, -  "function(array(int),array(int)" -  ",function(int:string):object)", +  "function(array(string),array(int)" +  ",function(string,int:string):object)",    0 );   }      void pike_module_exit(void)   {    exit_resultset_program();    exit_blob_program();    exit_blobs_program();    exit_linkfarm_program();   }