Main Page   Compound List   File List   Compound Members   File Members  

idngram.h File Reference

Stuff that is common to both text2idngram and wngram2idngram. More...

Go to the source code of this file.

Compounds

struct  hash_table
 A hash table. More...

struct  node
 Node in a hash. More...


Functions

int compare_ngrams (const void *ngram1, const void *ngram2)
int get_word (FILE *fp, char *word)
void merge_tempfiles (int start_file, int end_file, char *temp_file_root, char *temp_file_ext, int max_files, char *tempfiles_directory, FILE *outfile, flag write_ascii, int fof_size)
int nearest_prime (int num)
int hash (char *key, int M)
nodenew_node (char *key,unsigned short ind)
void new_hashtable (struct hash_table *table, int M)
int update_chain (struct node *t, char *key,unsigned short ind)
void add_to_hashtable (struct hash_table *table, unsigned long position, char *vocab_item, unsigned short ind)
unsigned short index2 (struct hash_table *vocab, char *word)

Variables

int n


Detailed Description

Stuff that is common to both text2idngram and wngram2idngram.

Definition in file idngram.h.


Function Documentation

void add_to_hashtable struct hash_table   table,
unsigned long    position,
char *    vocab_item,
unsigned short    ind
 

Definition at line 433 of file idngram.h.

References hash_table::chain, and update_chain().

Referenced by main().

int compare_ngrams const void *    ngram1,
const void *    ngram2
 

Definition at line 43 of file idngram.h.

References i, and n.

Referenced by main(), and merge_tempfiles().

int get_word FILE *    fp,
char *    word
 

Definition at line 72 of file idngram.h.

References MAX_WORD_LENGTH_FORMAT, and quit().

Referenced by main().

int hash char *    key,
int    M
 

Definition at line 379 of file idngram.h.

unsigned short index2 struct hash_table   vocab,
char *    word
 

Definition at line 441 of file idngram.h.

References hash_table::chain, fprintf(), hash(), node::ind, node::next, hash_table::size, and node::word.

Referenced by main().

void merge_tempfiles int    start_file,
int    end_file,
char *    temp_file_root,
char *    temp_file_ext,
int    max_files,
char *    tempfiles_directory,
FILE *    outfile,
flag    write_ascii,
int    fof_size
 

Definition at line 95 of file idngram.h.

References compare_ngrams(), flag, fprintf(), i, j, MAX, MAX_VOCAB_SIZE, merge_tempfiles(), n, quit(), rr_calloc(), rr_feof(), rr_fread(), rr_fwrite(), rr_iopen(), rr_malloc(), rr_oopen(), and salloc().

int nearest_prime int    num
 

Definition at line 358 of file idngram.h.

void new_hashtable struct hash_table   table,
int    M
 

Definition at line 403 of file idngram.h.

References hash_table::chain, i, new_node(), and hash_table::size.

struct node* new_node char *    key,
unsigned short    ind
 

Definition at line 391 of file idngram.h.

References node::ind, rr_malloc(), and node::word.

int update_chain struct node   t,
char *    key,
unsigned short    ind
 

Definition at line 416 of file idngram.h.

References new_node(), and node::next.


Variable Documentation

int n
 

Definition at line 38 of file idngram.h.

Referenced by compare_ngrams(), and merge_tempfiles().


Generated on Tue Dec 21 13:54:47 2004 by doxygen1.2.18