link-grammar-5.8.0/link-grammar/parse/fast-match.c
/**
 * Put the nearest_word-sorted disjuncts at sbin into the given hash table.
 * Since add_to_table_entry() inserts at entry's head, insert in the
 * reverse order than the needed match-list order of nearest_word.
 *
 * @param tsize The hash table size.
 * @param table The hash table.
 * @param w The word to which these disjuncts belong.
 * @param dir 0: Put it into a right table; 1: Put it  into a left table.
 * @param sbin Indexed by the disjuncts' shallow-connector nearest_word.
 * @param sent_length Sentence length, for sbin index upper bound.
 */
Put the nearest_word-sorted disjuncts at sbin into the given hash table.
Since add_to_table_entry() inserts at entry's head, insert in the
reverse order than the needed match-list order of nearest_word.

@param tsize The hash table size.
@param table The hash table.
@param w The word to which these disjuncts belong.
@param dir 0: Put it into a right table; 1: Put it  into a left table.
@param sbin Indexed by the disjuncts' shallow-connector nearest_word.
@param sent_length Sentence length, for sbin index upper bound.
Put the nearest_word - sorted disjuncts at sbin into the given hash table . Since add_to_table_entry () inserts at entry ' s head insert in the reverse order than the needed match - list order of nearest_word . @param tsize The hash table size . @param table The hash table . @param w The word to which these disjuncts belong . @param dir 0 : Put it into a right table ; 1 : Put it into a left table . @param sbin Indexed by the disjuncts ' shallow - connector nearest_word . @param sent_length Sentence length for sbin index upper bound .
static void put_into_match_table(unsigned int tsize, Match_node **table,
                                 int w, int dir, sortbin *sbin,
                                 size_t sent_length)
{
	if (0 == dir)
	{
		for (WordIdx sbw = 0; sbw < (WordIdx)w; sbw++)
		{
			add_to_table_entry(tsize, table, dir, &sbin[sbw]);
		}
	}
	else
	{
		for (WordIdx sbw = sent_length-1; sbw > (WordIdx)w; sbw--)
		{
			add_to_table_entry(tsize, table, dir, &sbin[sbw]);
		}
	}
}
static void put_into_match_table ( unsigned int tsize , Match_node * * table , int w , int dir , sortbin * sbin , size_t sent_length ) { if ( 0 == dir ) { for ( WordIdx sbw = 0 ; sbw < ( WordIdx ) w ; sbw ++ ) { add_to_table_entry ( tsize , table , dir , & sbin [ sbw ] ) ; } } else { for ( WordIdx sbw = sent_length - 1 ; sbw > ( WordIdx ) w ; sbw -- ) { add_to_table_entry ( tsize , table , dir , & sbin [ sbw ] ) ; } } }
Put the nearest_word-sorted disjuncts at sbin into the given hash table.
Put the nearest_word - sorted disjuncts at sbin into the given hash table .
/* Left match-list needed order: Increasing nearest_word. */ /* Right match-list needed order: Decreasing nearest_word. */