Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

kstem.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <string.h>

Compounds

struct  dictentry
struct  hashobj
struct  hte
struct  kstem_HSLOT

Defines

#define vowel(i)   (!cons(i))
#define TRUE   1
#define FALSE   0
#define MAX_WORD_LENGTH   25
#define MAX_FILENAME_LENGTH   125
#define MAX_ROOTS   9000
#define wordlength   (k + 1)
#define stemlength   (j + 1)
#define final_c   (word[k])
#define penult_c   (word[k-1])
#define DIR_SEP_CHAR   '/'
#define DIR_SEP_STRING   "/"
#define ends_in(s)   ends(s, strlen(s))
#define setsuffix(s)   setsuff(s, strlen(s))
#define stemhash(word, hval)   { unsigned short int ptr[6]; strncpy((char *)ptr, word, 12); hval = ((ptr[0]<<4)^ptr[1]^ptr[2]^ptr[3]^ptr[4]^ptr[5]) % stemhtsize; }
#define LOAD_FACTOR   (0.90)
#define MIN_ENTRIES   (32)
#define EXP_FACTOR   (2)
#define AVG_STRINGSIZE   (8)
#define MATCH(a, b)   (strcmp((a),(b)) == 0)
#define HASH2(a)   (a->hashdvsr2 - (a->hvalue % a->hashdvsr2))
#define EMPTY   (-1)
#define FAIL   (-1)
#define MAX(A, B)   ((A) > (B) ? (A) : (B))

Functions

void stemht_init ()
hashobjget_hashobj (int)
hashobjread_hashobj (int, char *)
int ho_find_ent (hashobj *t, const char *s)
int ho_lookup (hashobj *, const char *)
int ho_insert (hashobj *, const char *, int)
int set_size_hashobj (hashobj *, double)
void free_hashobj (hashobj *)
int ho_size (hashobj *)
int ho_used (hashobj *)
double ho_load_factor ()
int stralloc (hashobj *, int)
int hash1 (hashobj *, const char *)
int prime_lte (int)
int prime_gte (int)
int prime (int)
int count_lines (char *file_name)
char * add_file (char name[], char directory[], char filename[])
void kstem_allocate_memory (int num_deps)
void kstem_add_table_entry (const char *variant, const char *word)
int read_dict_info ()
dictentrygetdep (char *word)
int lookup (char *word)
int cons (int i)
int vowelinstem ()
int doublec (int i)
int ends (char *str, int sufflength)
void setsuff (char *str, int length)
void plural ()
void past_tense ()
void aspect ()
void ion_endings ()
void er_and_or_endings ()
void ly_endings ()
void al_endings ()
void ive_endings ()
void ize_endings ()
void ment_endings ()
void ity_endings ()
void ble_endings ()
void ness_endings ()
void ism_endings ()
void ic_endings ()
void ncy_endings ()
void nce_endings ()
int kstem_stem_tobuffer (char *term, char *buffer)
char * kstem_stemmer (char *term)
void kstem_release_memory ()

Variables

int stemhtsize
kstem_HSLOTstemht
int stemht_init_flag = 0
char * word
int j
int k
int dict_initialized_flag = FALSE
hashobjdict_ht
dictentrydep
dictentrymain_deps
int default_val
int dep_count
char * stemdir
int buf_size = 0

Define Documentation

#define AVG_STRINGSIZE   (8)
 

#define DIR_SEP_CHAR   '/'
 

#define DIR_SEP_STRING   "/"
 

#define EMPTY   (-1)
 

#define ends_in s       ends(s, strlen(s))
 

#define EXP_FACTOR   (2)
 

#define FAIL   (-1)
 

#define FALSE   0
 

#define final_c   (word[k])
 

#define HASH2      (a->hashdvsr2 - (a->hvalue % a->hashdvsr2))
 

#define LOAD_FACTOR   (0.90)
 

#define MATCH a,
b       (strcmp((a),(b)) == 0)
 

#define MAX A,
     ((A) > (B) ? (A) : (B))
 

#define MAX_FILENAME_LENGTH   125
 

#define MAX_ROOTS   9000
 

#define MAX_WORD_LENGTH   25
 

#define MIN_ENTRIES   (32)
 

#define penult_c   (word[k-1])
 

#define setsuffix s       setsuff(s, strlen(s))
 

#define stemhash word,
hval       { unsigned short int ptr[6]; strncpy((char *)ptr, word, 12); hval = ((ptr[0]<<4)^ptr[1]^ptr[2]^ptr[3]^ptr[4]^ptr[5]) % stemhtsize; }
 

#define stemlength   (j + 1)
 

#define TRUE   1
 

#define vowel      (!cons(i))
 

#define wordlength   (k + 1)
 


Function Documentation

char* add_file char    name[],
char    directory[],
char    filename[]
 

void al_endings   [static]
 

void aspect   [static]
 

void ble_endings   [static]
 

int cons int    i [static]
 

int count_lines char *    file_name
 

int doublec int    i [static]
 

int ends char *    str,
int    sufflength
[static]
 

void er_and_or_endings   [static]
 

void free_hashobj hashobj  
 

hashobj * get_hashobj int   
 

dictentry* getdep char *    word [static]
 

int hash1 hashobj  ,
const char *   
[static]
 

int ho_find_ent hashobj   t,
const char *    s
 

int ho_insert hashobj  ,
const char *   ,
int   
 

double ho_load_factor  
 

int ho_lookup hashobj  ,
const char *   
 

int ho_size hashobj  
 

int ho_used hashobj  
 

void ic_endings   [static]
 

void ion_endings   [static]
 

void ism_endings   [static]
 

void ity_endings   [static]
 

void ive_endings   [static]
 

void ize_endings   [static]
 

void kstem_add_table_entry const char *    variant,
const char *    word
 

void kstem_allocate_memory int    num_deps
 

void kstem_release_memory  
 

int kstem_stem_tobuffer char *    term,
char *    buffer
 

char* kstem_stemmer char *    term
 

int lookup char *    word [static]
 

void ly_endings   [static]
 

void ment_endings   [static]
 

void nce_endings   [static]
 

void ncy_endings   [static]
 

void ness_endings   [static]
 

void past_tense   [static]
 

void plural   [static]
 

int prime int    [static]
 

int prime_gte int    [static]
 

int prime_lte int    [static]
 

int read_dict_info  
 

hashobj* read_hashobj int   ,
char *   
 

int set_size_hashobj hashobj  ,
double   
 

void setsuff char *    str,
int    length
[static]
 

void stemht_init   [static]
 

int stralloc hashobj  ,
int   
[static]
 

int vowelinstem   [static]
 


Variable Documentation

int buf_size = 0 [static]
 

int default_val [static]
 

dictentry* dep [static]
 

int dep_count [static]
 

hashobj* dict_ht [static]
 

int dict_initialized_flag = FALSE [static]
 

int j [static]
 

int k [static]
 

dictentry* main_deps [static]
 

char* stemdir
 

kstem_HSLOT* stemht [static]
 

int stemht_init_flag = 0 [static]
 

int stemhtsize [static]
 

char* word [static]
 


Generated on Wed Nov 3 12:59:14 2004 for Lemur Toolkit by doxygen1.2.18