link-grammar-5.8.0/link-grammar/tokenize/wordgraph.c
/**
 * Create a short form of flags summary for displaying in a word node.
 */
Create a short form of flags summary for displaying in a word node.
Create a short form of flags summary for displaying in a word node .
const char *gword_status(Sentence sent, const Gword *w)
{
	dyn_str *s = dyn_str_new();
	const char *r;
	size_t len;
	if (w->status & WS_UNKNOWN)
		dyn_strcat(s, "UNK|");
	if (w->status & WS_INDICT)
		dyn_strcat(s, "IN|");
	if (w->status & WS_REGEX)
		dyn_strcat(s, "RE|");
	if (w->status & WS_SPELL)
		dyn_strcat(s, "SP|");
	if (w->status & WS_RUNON)
		dyn_strcat(s, "RU|");
	if (w->status & WS_HASALT)
		dyn_strcat(s, "HA|");
	if (w->status & WS_UNSPLIT)
		dyn_strcat(s, "UNS|");
	if (w->status & WS_PL)
		dyn_strcat(s, "PL|");
	char *status_str = dyn_str_take(s);
	len = strlen(status_str);
	if (len > 0) status_str[len-1] = '\0'; 
	r = string_set_add(status_str, sent->string_set);
	free(status_str);
	return r;
}
const char * gword_status ( Sentence sent , const Gword * w ) { dyn_str * s = dyn_str_new ( ) ; const char * r ; size_t len ; if ( w -> status & WS_UNKNOWN ) dyn_strcat ( s , " " ) ; if ( w -> status & WS_INDICT ) dyn_strcat ( s , " " ) ; if ( w -> status & WS_REGEX ) dyn_strcat ( s , " " ) ; if ( w -> status & WS_SPELL ) dyn_strcat ( s , " " ) ; if ( w -> status & WS_RUNON ) dyn_strcat ( s , " " ) ; if ( w -> status & WS_HASALT ) dyn_strcat ( s , " " ) ; if ( w -> status & WS_UNSPLIT ) dyn_strcat ( s , " " ) ; if ( w -> status & WS_PL ) dyn_strcat ( s , " " ) ; char * status_str = dyn_str_take ( s ) ; len = strlen ( status_str ) ; if ( len > 0 ) status_str [ len - 1 ] = ' \0 ' ; r = string_set_add ( status_str , sent -> string_set ) ; free ( status_str ) ; return r ; }
Create a short form of flags summary for displaying in a word node.
Create a short form of flags summary for displaying in a word node .
/* ditch the last '|' */