Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

wordvec.c File Reference


Detailed Description

Word vector.

Author:
Raphael Manfredi
Date:
2001-2003

#include "common.h"
#include "wordvec.h"
#include "utf8.h"
#include "walloc.h"
#include "zalloc.h"
#include "override.h"

Defines

#define WOVEC_DFLT   10 /**< Default size of word-vectors */
 Default size of word-vectors.


Functions

 RCSID ("$Id:wordvec.c, v 1.7 2005/06/25 01:37:43 daichik Exp $")
void word_vec_init (void)
 Initialize matching data structures.

void word_vec_close (void)
 Terminate matching data structures.

word_vec_tword_vec_zrealloc (word_vec_t *wv, gint ncount)
 Reallocate a word-vector from the zone into heap memory, to hold `ncount'.

guint word_vec_make (const gchar *query_str, word_vec_t **wovec)
 Given a query string, return a dynamically built word vector, along with the amount of items held into that vector.

void word_vec_free (word_vec_t *wovec, guint n)
 Release a word vector, containing `n' items.


Variables

zone_twovec_zone = NULL
 Word-vectors of WOVEC_DFLT entries.


Define Documentation

#define WOVEC_DFLT   10 /**< Default size of word-vectors */
 

Default size of word-vectors.


Function Documentation

RCSID "$Id:wordvec.  c,
v 1.7 2005/06/25 01:37:43 daichik Exp $" 
 

void word_vec_close void   ) 
 

Terminate matching data structures.

void word_vec_free word_vec_t wovec,
guint  n
 

Release a word vector, containing `n' items.

void word_vec_init void   ) 
 

Initialize matching data structures.

guint word_vec_make const gchar *  query_str,
word_vec_t **  wovec
 

Given a query string, return a dynamically built word vector, along with the amount of items held into that vector.

Words are broken on non-alphanumeric boundaries.

Returns:
the amount of valid items in the built vector, and fill `wovec' with the pointer to the allocated vector. If there are no items, there is no vector returned.

word_vec_t* word_vec_zrealloc word_vec_t wv,
gint  ncount
[static]
 

Reallocate a word-vector from the zone into heap memory, to hold `ncount'.


Variable Documentation

zone_t* wovec_zone = NULL [static]
 

Word-vectors of WOVEC_DFLT entries.


Generated on Sun Feb 12 10:50:10 2006 for Gtk-Gnutella by doxygen 1.3.6