libsent/src/dfa/rddfa.c File Reference

Read DFA grammar from a file. More...

#include <sent/stddefs.h>
#include <sent/dfa.h>

Go to the source code of this file.

Functions

void dfa_state_init (DFA_INFO *dinfo)
 Initialize and allocate DFA state information list in the grammar.
void dfa_state_expand (DFA_INFO *dinfo, int needed)
 Expand the state information list to the required length.
boolean rddfa (FILE *fp, DFA_INFO *dinfo)
 Top loop function to read DFA grammar via file pointer (gzip enabled).
boolean rddfa_fp (FILE *fp, DFA_INFO *dinfo)
 Top loop function to read DFA grammar via file descriptor.
boolean rddfa_line (char *line, DFA_INFO *dinfo, int *state_max, int *arc_num, int *terminal_max)
 Parse the input line and set grammar information, one by line.
void dfa_append (DFA_INFO *dst, DFA_INFO *src, int soffset, int coffset)
 Append the DFA state information to other.

Variables

static char buf [MAXLINELEN]
 Local text buffer.


Detailed Description

Read DFA grammar from a file.

Author:
Akinobu LEE
Date:
Tue Feb 15 14:54:40 2005
Revision
1.3

Definition in file rddfa.c.


Function Documentation

void dfa_state_init ( DFA_INFO dinfo  ) 

Initialize and allocate DFA state information list in the grammar.

Parameters:
dinfo [i/o] DFA grammar

Definition at line 36 of file rddfa.c.

Referenced by multigram_update(), rddfa(), and rddfa_fp().

void dfa_state_expand ( DFA_INFO dinfo,
int  needed 
)

Expand the state information list to the required length.

Parameters:
dinfo [i/o] DFA grammar
needed [in] required new length

Definition at line 57 of file rddfa.c.

Referenced by dfa_append(), and rddfa_line().

boolean rddfa ( FILE *  fp,
DFA_INFO dinfo 
)

Top loop function to read DFA grammar via file pointer (gzip enabled).

Parameters:
fp [in] file pointer that points to the DFA grammar data
dinfo [out] the read data will be stored in this DFA grammar structure
Returns:
TRUE on success, FALSE on failure.

Definition at line 80 of file rddfa.c.

Referenced by init_dfa().

boolean rddfa_fp ( FILE *  fp,
DFA_INFO dinfo 
)

Top loop function to read DFA grammar via file descriptor.

Parameters:
fp [in] file pointer that points to the DFA grammar data
dinfo [out] the read data will be stored in this DFA grammar structure
Returns:
TRUE on success, FALSE on failure.

Definition at line 110 of file rddfa.c.

boolean rddfa_line ( char *  line,
DFA_INFO dinfo,
int *  state_max,
int *  arc_num,
int *  terminal_max 
)

Parse the input line and set grammar information, one by line.

Parameters:
line [in] text buffer that holds a line of DFA file
dinfo [i/o] the read data will be appended to this DFA data
state_max [i/o] maximum number of state id appeared, will be updated
arc_num [i/o] number of read arcs, will be updated
terminal_max [i/o] maximum number of state id appended, will be updated
Returns:
TRUE if the line was successfully parsed, FALSE if failed.

Definition at line 143 of file rddfa.c.

Referenced by rddfa(), and rddfa_fp().

void dfa_append ( DFA_INFO dst,
DFA_INFO src,
int  soffset,
int  coffset 
)

Append the DFA state information to other.

Parameters:
dst [i/o] DFA grammar
src [i/o] DFA grammar to be appended to dst
soffset [in] offset state number in dst where the new state should be stored
coffset [in] category id offset in dst where the new data should be stored

Definition at line 218 of file rddfa.c.

Referenced by multigram_append_to_global().


Generated on Thu Jul 23 12:14:19 2009 for Julius by  doxygen 1.5.1