/** * File Name:chk_uword_dict.c */ /** chk_uword_dict * This function checks the Unkown word is present in the UDictionaryor not * It takes arguments: * word of char type ,base of char type, width of char type, nel of int type, * answer of char type, compar is function with int return type, * DBM_FLAG of iint type and * db object of DBM * Return void */ #include #include #include #include #include "defn.h" #include "struct1.h" #include "morph_logger.h" extern char *program_name; extern FILE *log_file; extern char *log_messg; //#define FUNCTION "fun_close()" #define FUNCTION "my_blk_bsearch()" /** * Prototypes of the functions in this file with a file scope */ extern char * my_blk_bsearch(); void chk_uword_dict(word,base,nel,width,compar,answer,DBM_FLAG,db) char base[WORD_SIZE],word[WORD_SIZE]; /* base address of the table, word is input word */ int nel,width; /* nel is table size and table width */ int (*compar)(); char answer[BigArray]; /* answer is the word after search */ int DBM_FLAG; /* global dictionary flag ,if 1 then dictionary is there */ GDBM_FILE db; /* GNU database manager includes dbm and ndb compatability and db is used for opening file */ { datum db_tag,db_out; /* datum is function of gdbm , db_tag is key and db_out is content */ struct uword_dict *tag_out; /* uword_dict structure contains source language and target language words */ int loop1; PRINT_LOG(log_file, "checking whether the Unkown word is present in the UDictionary or not\n"); sprintf(log_messg, "INFO: Entering into chk_uword_dict() to check |%s| ", word); PRINT_LOG(log_file, log_messg); for(loop1=0;loop1tl_word); else /* answer is equal to null */ answer[0]='\0'; } sprintf(log_messg, "INFO: leaving chk_uword_dict() |%s| ", word); PRINT_LOG(log_file, log_messg); }