link-grammar-5.8.0/link-grammar/dict-common/print-dict.c
/* Print one connector with all the details.
 * mCnameD<tracon_id>{refcount}(nearest_word, length_limit)x
 * Optional m: "@" for multi (else nothing).
 * Cname: Connector name.
 * Optional D: "-" / "+" (if dir != -1).
 * Optional <tracon_id>: (flag 't').
 * Optional [nearest_word, length_limit or farthest_word]: (flag 'l').
 * x: Shallow/deep indication as "s" / "d" (if shallow != -1)
 */
Print one connector with all the details.
Print one connector with all the details .
static void dyn_print_one_connector(dyn_str *s, Connector *e, int dir,
                                    int shallow, uint32_t flags)
{
	if (e->multi)
		dyn_strcat(s, "@");
	dyn_strcat(s, (e->desc != NULL) ? connector_string(e) : "NULLDESC");
	if (-1 != dir) dyn_strcat(s, (dir == 0) ? "-" : "+");
	if (is_flag(flags, 't') && e->tracon_id)
		append_string(s, "<%d>", e->tracon_id);
	if (is_flag(flags, 'r') && e->refcount)
		append_string(s, "{%d}",e->refcount);
	if (is_flag(flags, 'l'))
		append_string(s, "(%d,%d)", e->nearest_word, e->length_limit);
#if 0
	append_string(s, "<<%d>>", e->exp_pos);
#endif
	if (-1 != shallow)
		dyn_strcat(s, (0 == shallow) ? "d" : "s");
}
static void dyn_print_one_connector ( dyn_str * s , Connector * e , int dir , int shallow , uint32_t flags ) { if ( e -> multi ) dyn_strcat ( s , " " ) ; dyn_strcat ( s , ( e -> desc != NULL ) ? connector_string ( e ) : " " ) ; if ( -1 != dir ) dyn_strcat ( s , ( dir == 0 ) ? " " : " " ) ; if ( is_flag ( flags , ' ' ) && e -> tracon_id ) append_string ( s , " " , e -> tracon_id ) ; if ( is_flag ( flags , ' ' ) && e -> refcount ) append_string ( s , " " , e -> refcount ) ; if ( is_flag ( flags , ' ' ) ) append_string ( s , " " , e -> nearest_word , e -> length_limit ) ; #if 0 append_string ( s , " " , e -> exp_pos ) ; #endif if ( -1 != shallow ) dyn_strcat ( s , ( 0 == shallow ) ? " " : " " ) ; }
Print one connector with all the details.
Print one connector with all the details .