예제 #1
0
int build_parse_set(Sentence sent, int cost, Parse_Options opts) {
    /* This is the top level call that computes the whole parse_set.  It
       points whole_set at the result.  It creates the necessary hash
       table (x_table) which will be freed at the same time the
       whole_set is freed.

       It also assumes that count() has been run, and that hash table is
       filled with the values thus computed.  Therefore this function
       must be structured just like parse() (the main function for
       count()).  
       
       If the number of linkages gets huge, then the counts can overflow.
       We check if this has happened when verifying the parse set.
       This routine returns TRUE iff overflowed occurred.
    */

    Parse_set * whole_set;

    local_sent = sent->word;
    islands_ok = opts->islands_ok;

    whole_set = 
        parse_set(NULL, NULL, -1, sent->length, NULL, NULL, cost+1, sent->parse_info);

    if ((whole_set != NULL) && (whole_set->current != NULL)) {
	whole_set->current = whole_set->first;
    }

    sent->parse_info->parse_set = whole_set;

    local_sent = NULL;
    return verify_set(sent->parse_info);  
}
예제 #2
0
int build_parse_set(Sentence sent, int cost, Parse_Options opts)
{
	Parse_set * whole_set;

	whole_set =
		parse_set(sent, NULL, NULL, -1, sent->length, NULL, NULL, cost+1,
		          opts->islands_ok, sent->parse_info);

	if ((whole_set != NULL) && (whole_set->current != NULL)) {
		whole_set->current = whole_set->first;
	}

	sent->parse_info->parse_set = whole_set;

	return verify_set(sent->parse_info);
}
예제 #3
0
bool build_parse_set(Sentence sent, fast_matcher_t *mchxt,
                     count_context_t *ctxt,
                     unsigned int null_count, Parse_Options opts)
{
    Parse_set * whole_set;

    whole_set =
        mk_parse_set(sent, mchxt, ctxt,
                     NULL, NULL, -1, sent->length, NULL, NULL, null_count+1,
                     opts->islands_ok, sent->parse_info);

    if ((whole_set != NULL) && (whole_set->current != NULL)) {
        whole_set->current = whole_set->first;
    }

    sent->parse_info->parse_set = whole_set;

    return verify_set(sent->parse_info);
}