Example #1
0
static void
set_connector_length_limits(Sentence sent, Parse_Options opts)
{
	size_t i;
	unsigned int len = opts->short_length;
	bool all_short = opts->all_short;
	Connector_set * ucs = sent->dict->unlimited_connector_set;
	const char * ZZZ = string_set_add("ZZZ", sent->dict->string_set);

	if (0)
	{
		/* Not setting the length_limit saves observable time. However, if we
		 * would like to set the ZZZ connector length_limit to 1 for all
		 * sentences, we cannot do the following.
		 * FIXME(?): Use a flag that the sentence contains an empty word. */
		if (len >= sent->length) return; /* No point to enforce short_length. */
	}

	if (len > UNLIMITED_LEN) len = UNLIMITED_LEN;

	for (i=0; i<sent->length; i++)
	{
		Disjunct *d;
		for (d = sent->word[i].d; d != NULL; d = d->next)
		{
			set_connector_list_length_limit(d->left, ucs, len, all_short, ZZZ);
			set_connector_list_length_limit(d->right, ucs, len, all_short, ZZZ);
		}
	}
}
Example #2
0
static void set_connector_length_limits(Sentence sent, Parse_Options opts) {
    int i;
    int len;
    Disjunct *d;

    len = opts->short_length;
    if (len > UNLIMITED_LEN) len = UNLIMITED_LEN;
    
    for (i=0; i<sent->length; i++) {
	for (d = sent->word[i].d; d != NULL; d = d->next) {
	    set_connector_list_length_limit(d->left, sent->dict->unlimited_connector_set, len, opts);
	    set_connector_list_length_limit(d->right, sent->dict->unlimited_connector_set, len, opts);
	}
    }
}