compdic.c File Reference


Detailed Description

Program used to compress a dictionary.

Author:
Antoine Fraboulet
Date:
1999

Definition in file compdic.c.

#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include "hashtable.h"
#include "dic_internals.h"

Go to the source code of this file.

Defines

#define CHECK_RECURSION
#define MAX_STRING_LENGTH   200
#define MAX_EDGES   2000
#define SCALE   0.6

Functions

char * load_uncompressed (const char *file_name, unsigned int *dic_size)
int file_length (const char *file_name)
void skip_init_header (FILE *outfile, Dict_header *header)
void fix_header (FILE *outfile, Dict_header *header)
void print_header_info (Dict_header *header)
void write_node (Dawg_edge *edges, int size, int num, FILE *outfile)
unsigned int makenode (char *prefix)
int main (int argc, char *argv[])

Variables

FILE * global_outfile
Dict_header global_header
Hash_table global_hashtable
char global_stringbuf [MAX_STRING_LENGTH]
char * global_endstring
char * global_input
char * global_endofinput
int current_rec = 0
int max_rec = 0


Define Documentation

#define CHECK_RECURSION
 

Definition at line 42 of file compdic.c.

#define MAX_EDGES   2000
 

Definition at line 152 of file compdic.c.

Referenced by makenode().

#define MAX_STRING_LENGTH   200
 

Definition at line 149 of file compdic.c.

#define SCALE   0.6
 

Referenced by main().


Function Documentation

int file_length const char *  file_name  ) 
 

Definition at line 75 of file compdic.c.

Referenced by main().

void fix_header FILE *  outfile,
Dict_header header
 

Definition at line 101 of file compdic.c.

References _COMPIL_KEYWORD_, _Dict_header::edgesused, _Dict_header::ident, and _Dict_header::root.

Referenced by main().

char* load_uncompressed const char *  file_name,
unsigned int *  dic_size
 

Definition at line 45 of file compdic.c.

Referenced by main().

int main int  argc,
char *  argv[]
 

Definition at line 268 of file compdic.c.

References file_length(), fix_header(), global_endofinput, global_endstring, global_input, global_outfile, global_stringbuf, hash_destroy(), hash_init(), _Dawg_edge::last, load_uncompressed(), makenode(), max_rec, print_header_info(), _Dawg_edge::ptr, SCALE, skip_init_header(), and write_node().

unsigned int makenode char *  prefix  ) 
 

Definition at line 179 of file compdic.c.

References _Dawg_edge::chr, current_rec, DIC_CHAR_MASK, _Dict_header::edgessaved, _Dict_header::edgesused, _Dawg_edge::fill, global_endofinput, global_endstring, global_input, global_outfile, global_stringbuf, hash_add(), hash_find(), _Dawg_edge::last, MAX_EDGES, max_rec, _Dict_header::nodessaved, _Dict_header::nodesused, _Dict_header::nwords, _Dawg_edge::ptr, _Dawg_edge::term, and write_node().

Referenced by main().

void print_header_info Dict_header header  ) 
 

Definition at line 111 of file compdic.c.

References _COMPIL_KEYWORD_, _Dict_header::edgessaved, _Dict_header::edgesused, _Dict_header::nodessaved, _Dict_header::nodesused, _Dict_header::nwords, and _Dict_header::root.

Referenced by main().

void skip_init_header FILE *  outfile,
Dict_header header
 

Definition at line 85 of file compdic.c.

References _Dict_header::edgessaved, _Dict_header::edgesused, _Dict_header::nodessaved, _Dict_header::nodesused, _Dict_header::nwords, _Dict_header::root, _Dict_header::unused_1, and _Dict_header::unused_2.

Referenced by main().

void write_node Dawg_edge edges,
int  size,
int  num,
FILE *  outfile
 

Definition at line 130 of file compdic.c.

Referenced by main(), and makenode().


Variable Documentation

int current_rec = 0
 

Definition at line 174 of file compdic.c.

Referenced by makenode().

char* global_endofinput
 

Definition at line 164 of file compdic.c.

Referenced by main(), and makenode().

char* global_endstring
 

Definition at line 162 of file compdic.c.

Referenced by main(), and makenode().

Hash_table global_hashtable
 

Definition at line 159 of file compdic.c.

Dict_header global_header
 

Definition at line 158 of file compdic.c.

char* global_input
 

Definition at line 163 of file compdic.c.

Referenced by main(), and makenode().

FILE* global_outfile
 

Definition at line 157 of file compdic.c.

Referenced by main(), and makenode().

char global_stringbuf[MAX_STRING_LENGTH]
 

Definition at line 161 of file compdic.c.

Referenced by main(), and makenode().

int max_rec = 0
 

Definition at line 175 of file compdic.c.

Referenced by main(), and makenode().


Generated on Thu Dec 29 02:01:15 2005 for Eliot by  doxygen 1.4.5