link-grammar-5.8.0/link-grammar/parse/parse.c
/**
 *  Print the chosen_disjuncts words.
 *  This is used for debug, e.g. for tracking them in the Wordgraph display.
 */
Print the chosen_disjuncts words.
This is used for debug, e.g. for tracking them in the Wordgraph display.
Print the chosen_disjuncts words . This is used for debug e . g . for tracking them in the Wordgraph display .
static void print_chosen_disjuncts_words(const Linkage lkg, bool prt_optword)
{
	size_t i;
	dyn_str *djwbuf = dyn_str_new();
	err_msg(lg_Debug, "Linkage %p (%zu words): ", lkg, lkg->num_words);
	for (i = 0; i < lkg->num_words; i++)
	{
		Disjunct *cdj = lkg->chosen_disjuncts[i];
		const char *djw; 
		if (NULL == cdj)
			djw = (prt_optword && lkg->sent->word[i].optional) ? "{}" : "[]";
		else if ('\0' == cdj->word_string[0])
			djw = "\\0"; 
		else
			djw = cdj->word_string;
		dyn_strcat(djwbuf, djw);
		dyn_strcat(djwbuf, " ");
	}
	err_msg(lg_Debug, "%s\n", djwbuf->str);
	dyn_str_delete(djwbuf);
}
static void print_chosen_disjuncts_words ( const Linkage lkg , bool prt_optword ) { size_t i ; dyn_str * djwbuf = dyn_str_new ( ) ; err_msg ( lg_Debug , " " , lkg , lkg -> num_words ) ; for ( i = 0 ; i < lkg -> num_words ; i ++ ) { Disjunct * cdj = lkg -> chosen_disjuncts [ i ] ; const char * djw ; if ( NULL == cdj ) djw = ( prt_optword && lkg -> sent -> word [ i ] . optional ) ? " " : " " ; else if ( ' \0 ' == cdj -> word_string [ 0 ] ) djw = " \\ " ; else djw = cdj -> word_string ; dyn_strcat ( djwbuf , djw ) ; dyn_strcat ( djwbuf , " " ) ; } err_msg ( lg_Debug , " \n " , djwbuf -> str ) ; dyn_str_delete ( djwbuf ) ; }
Print the chosen_disjuncts words.
Print the chosen_disjuncts words .
/* disjunct word - the chosen word */ /* null string - something is wrong */