link-grammar-5.8.0/link-grammar/parse/fast-match.c
/**
 * Put the Match_node m into a list according to nearest_word.
 * This is a bucket sort.
 */
Put the Match_node m into a list according to nearest_word.
This is a bucket sort.
Put the Match_node m into a list according to nearest_word . This is a bucket sort .
static void sort_by_nearest_word(Match_node *m, sortbin *sbin, int nearest_word)
{
	sbin = &sbin[nearest_word]; 
#if ML_COMPAT
	if (NULL == sbin->head)
	{
		sbin->head = m;
	}
	else
	{
		sbin->tail->next = m;
	}
	sbin->tail = m;
	m->next = NULL;
#else
	m->next = sbin->head;
	sbin->head = m;
#endif
}
static void sort_by_nearest_word ( Match_node * m , sortbin * sbin , int nearest_word ) { sbin = & sbin [ nearest_word ] ; #if ML_COMPAT if ( NULL == sbin -> head ) { sbin -> head = m ; } else { sbin -> tail -> next = m ; } sbin -> tail = m ; m -> next = NULL ; #else m -> next = sbin -> head ; sbin -> head = m ; #endif }
Put the Match_node m into a list according to nearest_word.
Put the Match_node m into a list according to nearest_word .
/* Bucket selection. */