/* file include/plex/fcndcls.h                           */
/* local function declarations                           */
/* last modified 5/25/00                                 */

#ifndef LEX_FCNDCLS_HEADER
#define LEX_FCNDCLS_HEADER

extern void           add_item_to_plex1(LEX_FILE_INDEX *plex,LEX_ITEM3 *lex_item,int *perr);
extern void           add_to_ordered_wlist(struct LEXSTR2 *wlist, char *spelling, double val);
extern NUM_REL        collapse_rates(NUM_REL *rate1, NUM_REL *rate2);
extern boolean        corres_key_equal(CORRESPONDENCE *i, CORRESPONDENCE *j, int symmetric);
extern void           corres_tally(CORRESPONDENCE *x, CORRES_TALLY2_STR *cortab, int symmetric);
extern void           copy_item(LEX_ITEM3 *item1, LEX_ITEM3 *item2);
extern void           copy_pron(struct PRON_SPEC *pron1, struct PRON_SPEC *pron2);
extern void           dump_corres(CORRESPONDENCE *x);
extern void           dump_cortab(CORRES_TALLY2_STR *cortab);
extern NUM_REL        getrate1(LEX_ITEM3 *item, int ipron);
extern void           tag_delete_dup_prons(LEX_ITEM3 *item, int *del_pron);
extern void           dump_lex_item3(LEX_ITEM3 *item);
extern void           dump_lex_index(LEX_FILE_INDEX *ltab);
extern void           dump_lex_index2(LEX_FILE_INDEX *ltab, int detail_level);
extern void           dump_sylbs(struct SYLB1 *sylb, int nsylbs);
extern void           dump_wlist(struct LEXSTR2 *wlist);
extern void           dump_words(struct WORD1 *word, int nwords);
extern void           find_spell_alts(struct LEXSTR2 *restricting_wlist,char *keyword,struct LEXSTR2 *returned_wlist,int *perr);
extern char          *fix_stress_before_sylb(char *sx2, char *sx1);
extern void           free_item_space(LEX_ITEM3 *item);
extern void           free_pron_space(struct PRON_SPEC *pron);
extern void           free_lex_index2(LEX_FILE_INDEX *ltab);
extern double         freq_from_vocf_file(FILE *fp_vocf, char *comment_flag_vocf,char *target_key, char *vocf_item_key, long int *n_vocf_items);
extern void           get_nstr_table(int **tab, int *n, int nmax, char *fname, pcodeset *pcode, char *comment_flag, int *perr);
extern void           get_lex_entries(LEX_ITEM3 *item, int *nitems, char *spelling, LEX_FILE_INDEX *lextab, int *perr);
extern void           get_lex_entries_all(LEX_ITEM3 *item, int *nitems, char *spelling, LEX_FILE_INDEX *lextab, int *perr);
extern void           get_lex_index2(char *fname, LEX_FILE_INDEX *ltab, int *perr);
extern void           get_lfile_entries1(LEX_ITEM3 *item, int *nitems, char *key, char *fname, char *mode, char *format, int no_comments, int *perr);
extern void           get_lfile_entries1_all(LEX_ITEM3 *item, int *nitems, char *key, char *fname, char *mode, char *format, int no_comments, int *perr);
extern void           get_next_lex_entry2(char *rec, int rec_length, FILE *fp_in, char *format,int no_comments, char **comment_flag, long int *nlines, int *perr);
extern char          *get_vocf_key(char *vocf_rec);
extern void           interchange_corres(CORRES_TALLY2_STR *cortab, int i, int j);
extern int            ilex1(struct LEXSTR1 *plex, char *ps);
extern void           dump_lex1(struct LEXSTR1 *plex);
extern void           read_in_plex_entries(LEX_FILE_INDEX *ltab, int lex_lim, int *perr);
extern void           sorta_lex1(struct LEXSTR1 *plex);
extern void           sortf_lex1(struct LEXSTR1 *plex);
extern void           add_to_lex(struct LEXSTR1 *plex, char *utt);
extern void           free_lex(struct LEXSTR1 *plex);
extern char          *multi_pron_indicator1(char *sx);
extern boolean        no_word_boundl(WCHAR_T *bnd_int, struct INTERVAL1 cluster, int iwordbound);
extern boolean        no_word_boundr(WCHAR_T *bnd_int, struct INTERVAL1 cluster, int iwordbound);
extern int            n_plex_items(LEX_FILE_INDEX *plex, int *perr);
extern void           orth2key1(char *key, char *orth, int *perr);
extern void           orth2key1_prot(PROTECTED_CHR_STR *key, char *orth, int *perr);
extern void           parse_lex_item3(LEX_ITEM3 *item, char *rec, char *format, int *perr);
extern void           parse_lex_item3_ap(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_bu(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_ce(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_cmu(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_dragon(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_ldc1(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_lim(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_moby(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_ort(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_pcd(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_sort1(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_sort2(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_ti(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_tim(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_ucla(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_voc1(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item3_vocf(LEX_ITEM3 *item, char *rec, int *perr);
extern void           parse_lex_item4(LEX_ITEM3 *item, char *rec, char *format, int *perr);
extern void           process_lexdef_aux_line2(LEX_FILE_INDEX *ltab,char *pl1,int *perr);
extern boolean        prons_eq(struct PRON_SPEC *pron1, struct PRON_SPEC *pron2);
extern boolean        prons_eq3(struct PRON_SPEC *pron1, struct PRON_SPEC *pron2);
extern boolean        prons_eq_wtag(struct PRON_SPEC *pron1, struct PRON_SPEC *pron2);
extern char           *scatss(char *s2, SUBSTRING *ss1);
extern void           separate_orth(char *snor, char *caps, char *diacritics, char *orth);
extern void           separate_orth_prot(PROTECTED_CHR_STR *snor, PROTECTED_CHR_STR *caps, PROTECTED_CHR_STR *diacritics, char *orth);
extern void           simplify_prons3(LEX_ITEM3 *item, int *del_pron);
extern void         str_encode(char *s, char *sx, char *sy);
extern void         warn_no_nl(FILE *fp, char *rec, int rmax, char *proc);
extern boolean      warn_no_nl2(FILE *fp, char *rec, int rmax, char *proc);
extern void         write_lex_item(LEX_ITEM3 *item, FILE *fp_out, char *format, int *perr);
extern void         write_lex_item2(LEX_ITEM3 *item, int *del_pron,FILE *fp_out, char *format, int *perr);

/* function declarations (prototypes) for lex2 functions: */

 void get_wlist2(struct LEXSTR2 *wlist,char *fname, int *perr);
 void add_to_ordered_wlist(struct LEXSTR2 *wlist, char *spelling, double val);
 void dump_wlist(struct LEXSTR2 *wlist);
 boolean word_in_wlist(struct LEXSTR2 *wlist, char *word);
 void find_spell_alts(struct LEXSTR2 *restricting_wlist,
   char *keyword, struct LEXSTR2 *returned_wlist,int *perr);
 void find_homophones1(TABLE_OF_CODESETS *pcdtab,struct LEXSTR2 *restricting_wlist,
   char *keyword, struct LEXSTR2 *returned_wlist,int *perr);
 void find_homophones2(TABLE_OF_CODESETS *pcdtab,struct LEXSTR2 *restricting_wlist,
   char *keyword, struct LEXSTR2 *returned_wlist, double min_length_ratio, int *perr);

#endif
/* end file include/plex/fcndcls.h        */
