link-grammar-5.8.0/link-grammar/linkage/linkage.c
/**
 * Add a null word node that represents two or more null morphemes.
 * Used for "unifying" null morphemes that are part of a single subword,
 * when only some of its morphemes (2 or more) don't have a linkage.
 * The words "start" to "end" (including) are unified by the new node.
 */
Add a null word node that represents two or more null morphemes.
Used for "unifying" null morphemes that are part of a single subword,
when only some of its morphemes (2 or more) don't have a linkage.
The words "start" to "end" (including) are unified by the new node.
Add a null word node that represents two or more null morphemes . Used for " unifying " null morphemes that are part of a single subword when only some of its morphemes ( 2 or more ) don ' t have a linkage . The words " start " to " end " ( including ) are unified by the new node .
static Gword *wordgraph_null_join(Sentence sent, Gword **start, Gword **end)
{
	Gword *new_word;
	Gword **w;
	char *usubword;
	size_t join_len = 0;
	for (w = start; w <= end; w++) join_len += strlen((*w)->subword);
	usubword = calloc(join_len+1, 1); 
	for (w = start; w <= end; w++)
		add_morpheme_unmarked(sent, usubword, (*w)->subword, (*w)->morpheme_type);
	new_word = gword_new(sent, usubword);
	free(usubword);
	new_word->status |= WS_PL;
	new_word->label = "NJ";
	new_word->null_subwords = NULL;
	new_word->start = (*start)->start;
	new_word->end = (*end)->end;
	for (w = start; w <= end; w++)
		gwordlist_append(&new_word->null_subwords, (Gword *)(*w));
	return new_word;
}
static Gword * wordgraph_null_join ( Sentence sent , Gword * * start , Gword * * end ) { Gword * new_word ; Gword * * w ; char * usubword ; size_t join_len = 0 ; for ( w = start ; w <= end ; w ++ ) join_len += strlen ( ( * w ) -> subword ) ; usubword = calloc ( join_len + 1 , 1 ) ; for ( w = start ; w <= end ; w ++ ) add_morpheme_unmarked ( sent , usubword , ( * w ) -> subword , ( * w ) -> morpheme_type ) ; new_word = gword_new ( sent , usubword ) ; free ( usubword ) ; new_word -> status |= WS_PL ; new_word -> label = " " ; new_word -> null_subwords = NULL ; new_word -> start = ( * start ) -> start ; new_word -> end = ( * end ) -> end ; for ( w = start ; w <= end ; w ++ ) gwordlist_append ( & new_word -> null_subwords , ( Gword * ) ( * w ) ) ; return new_word ; }
Add a null word node that represents two or more null morphemes.
Add a null word node that represents two or more null morphemes .
/* zeroed out */ /* Link the null_subwords links of the added unifying node to the null
	 * subwords it unified. */ /* Removing const qualifier, but gwordlist_append doesn't change w->... .  */