IDZEBRA  2.1.2
Data Structures | Functions | Variables
rank1.c File Reference
#include <stdio.h>
#include <assert.h>
#include "index.h"
#include "rank.h"

Go to the source code of this file.

Data Structures

struct  rank_class_info
 
struct  rank_term_info
 
struct  rank_set_info
 

Functions

static int log2_int (zint g)
 
static void * create (ZebraHandle zh)
 
static void destroy (struct zebra_register *reg, void *class_handle)
 
static void * begin (struct zebra_register *reg, void *class_handle, RSET rset, NMEM nmem, TERMID *terms, int numterms)
 
static void end (struct zebra_register *reg, void *set_handle)
 
static void add (void *set_handle, int seqno, TERMID term)
 
static int calc_1 (void *set_handle, zint sysno, zint staticrank, int *stop_flag)
 
static int calc_2 (void *set_handle, zint sysno, zint staticrank, int *stop_flag)
 

Variables

static int log_level = 0
 
static int log_initialized = 0
 
static struct rank_control rank_1_control
 
struct rank_controlrank_1_class = &rank_1_control
 
static struct rank_control rank_2_control
 
struct rank_controlrank_2_class = &rank_2_control
 

Function Documentation

static void add ( void *  set_handle,
int  seqno,
TERMID  term 
)
static

add: Called for each word occurence in a result set. This routine should be as fast as possible. This routine should "incrementally" update the score.

Definition at line 168 of file rank1.c.

References rank_set_info::last_pos, rank_term_info::local_occur, log_level, rset_term::name, and rset_term::rankpriv.

Referenced by main(), rpn_search_APT_numeric(), and search_terms_chrmap().

static void* begin ( struct zebra_register reg,
void *  class_handle,
RSET  rset,
NMEM  nmem,
TERMID terms,
int  numterms 
)
static

begin: Prepares beginning of "real" ranking. Called once for each result set. The returned handle is a "set handle" and will be used in each of the handlers below.

Definition at line 107 of file rank1.c.

References rank_set_info::entries, rank_term_info::global_inv, rank_term_info::global_occur, rank_term_info::local_occur, log2_int(), log_level, rank_set_info::nmem, rank_set_info::no_entries, rank_set_info::no_rank_entries, rank_term_info::rank_flag, rank_term_info::rank_weight, rset_term::rankpriv, rset_count(), rank_term_info::term, rank_term_info::term_index, and ZINT_FORMAT.

Referenced by scan_string().

static int calc_1 ( void *  set_handle,
zint  sysno,
zint  staticrank,
int *  stop_flag 
)
static
static int calc_2 ( void *  set_handle,
zint  sysno,
zint  staticrank,
int *  stop_flag 
)
static

Definition at line 220 of file rank1.c.

References calc_1().

static void* create ( ZebraHandle  zh)
static

Definition at line 74 of file rank1.c.

References log_initialized, and log_level.

static void destroy ( struct zebra_register reg,
void *  class_handle 
)
static

Definition at line 93 of file rank1.c.

References log_level.

Referenced by recTypes_destroy().

static void end ( struct zebra_register reg,
void *  set_handle 
)
static

Definition at line 156 of file rank1.c.

References log_level.

Referenced by scan_string().

static int log2_int ( zint  g)
static

Definition at line 60 of file rank1.c.

Referenced by begin(), and calc_1().

Variable Documentation

int log_initialized = 0
static

Definition at line 36 of file rank1.c.

Referenced by create().

int log_level = 0
static

Definition at line 35 of file rank1.c.

Referenced by add(), begin(), calc_1(), create(), destroy(), and end().

struct rank_control* rank_1_class = &rank_1_control

Definition at line 254 of file rank1.c.

Referenced by zebra_register_open().

struct rank_control rank_1_control
static
Initial value:
= {
"rank-1",
end,
add,
}
static void destroy(struct zebra_register *reg, void *class_handle)
Definition: rank1.c:93
static void * begin(struct zebra_register *reg, void *class_handle, RSET rset, NMEM nmem, TERMID *terms, int numterms)
Definition: rank1.c:107
static void add(void *set_handle, int seqno, TERMID term)
Definition: rank1.c:168
static void end(struct zebra_register *reg, void *set_handle)
Definition: rank1.c:156
static int calc_1(void *set_handle, zint sysno, zint staticrank, int *stop_flag)
Definition: rank1.c:192
static void * create(ZebraHandle zh)
Definition: rank1.c:74

Definition at line 245 of file rank1.c.

struct rank_control* rank_2_class = &rank_2_control

Definition at line 266 of file rank1.c.

Referenced by zebra_register_open().

struct rank_control rank_2_control
static
Initial value:
= {
"rank-2",
end,
add,
}
static void destroy(struct zebra_register *reg, void *class_handle)
Definition: rank1.c:93
static void * begin(struct zebra_register *reg, void *class_handle, RSET rset, NMEM nmem, TERMID *terms, int numterms)
Definition: rank1.c:107
static void add(void *set_handle, int seqno, TERMID term)
Definition: rank1.c:168
static void end(struct zebra_register *reg, void *set_handle)
Definition: rank1.c:156
static int calc_2(void *set_handle, zint sysno, zint staticrank, int *stop_flag)
Definition: rank1.c:220
static void * create(ZebraHandle zh)
Definition: rank1.c:74

Definition at line 256 of file rank1.c.