예제 #1
0
파일: prune.c 프로젝트: ampli/link-grammar
static Cms * lookup_in_cms_table(multiset_table *cmt, const char * str)
{
	Cms * cms;
	for (cms = cmt->cms_table[cms_hash(str)]; cms != NULL; cms = cms->next)
	{
		if (string_set_cmp(str, cms->name)) return cms;
	}
	return NULL;
}
예제 #2
0
/**
 * This function puts connector c into the connector table
 * if one like it isn't already there.
 */
static void insert_connector(connector_table *ct, Connector * c)
{
	unsigned int h;
	Connector * e;

	h = hash_S(c);

	for (e = ct[h]; e != NULL; e = e->tableNext)
	{
		if (string_set_cmp(c->string, e->string))
			return;
	}
	c->tableNext = ct[h];
	ct[h] = c;
}
예제 #3
0
static void
set_connector_list_length_limit(Connector *c,
                                Connector_set *conset,
                                int short_len,
                                bool all_short,
                                const char * ZZZ)
{
	for (; c!=NULL; c=c->next)
	{
		if (string_set_cmp (ZZZ, c->string))
		{
			c->length_limit = 1;
		}
		else if (all_short ||
		         (conset != NULL && !match_in_connector_set(conset, c)))
		{
			c->length_limit = short_len;
		}
	}
}