link-grammar-5.8.0/link-grammar/dict-sql/read-sql.c
/* callback -- set bs->dn to the dict nodes for a word in the dict */
- set bs->dn to the dict nodes for a word in the dict
- set bs - > dn to the dict nodes for a word in the dict
static int morph_cb(void *user_data, int argc, char **argv, char **colName)
{
	assert(2 == argc, "Bad column count");
	assert(argv[0], "NULL column value");
	char * scriword = argv[0];
	char * wclass = argv[1];
	cbdata* bs = user_data;
	bs->exp = NULL;
	db_lookup_exp(bs->dict, wclass, bs);
	assert(NULL != bs->exp, "Missing disjuncts for word %s %s",
		scriword, wclass);
	Dict_node *dn = malloc(sizeof(Dict_node));
	memset(dn, 0, sizeof(Dict_node));
	dn->string = string_set_add(scriword, bs->dict->string_set);
	dn->right = bs->dn;
	dn->exp = bs->exp;
	bs->dn = dn;
	return 0;
}
static int morph_cb ( void * user_data , int argc , char * * argv , char * * colName ) { assert ( 2 == argc , " " ) ; assert ( argv [ 0 ] , " " ) ; char * scriword = argv [ 0 ] ; char * wclass = argv [ 1 ] ; cbdata * bs = user_data ; bs -> exp = NULL ; db_lookup_exp ( bs -> dict , wclass , bs ) ; assert ( NULL != bs -> exp , " " , scriword , wclass ) ; Dict_node * dn = malloc ( sizeof ( Dict_node ) ) ; memset ( dn , 0 , sizeof ( Dict_node ) ) ; dn -> string = string_set_add ( scriword , bs -> dict -> string_set ) ; dn -> right = bs -> dn ; dn -> exp = bs -> exp ; bs -> dn = dn ; return 0 ; }
callback -- set bs->dn to the dict nodes for a word in the dict
callback -- set bs - > dn to the dict nodes for a word in the dict
/* Now look up the expressions for each word */ /* Well, if we found a classname for a word, then there really,
	 * really should be able to find one or more corresponding disjuncts.
	 * However, it is possible to have corrupted databases which do not
	 * have any disjuncts for a word class.  We complain about those.
	 */ /* Put each word into a Dict_node. */