示例#1
0
static void put_opts_in_local_vars(Parse_Options opts)
{
	local.verbosity = parse_options_get_verbosity(opts);
	local.timeout = parse_options_get_max_parse_time(opts);;
	local.memory = parse_options_get_max_memory(opts);;
	local.linkage_limit = parse_options_get_linkage_limit(opts);
	local.null_block = parse_options_get_null_block(opts);
	local.islands_ok = parse_options_get_islands_ok(opts);
	local.spell_guess = parse_options_get_spell_guess(opts);
	local.short_length = parse_options_get_short_length(opts);
	local.cost_model = parse_options_get_cost_model_type(opts);
	local.max_cost = parse_options_get_disjunct_costf(opts);
	local.echo_on = parse_options_get_echo_on(opts);
	local.batch_mode = parse_options_get_batch_mode(opts);
	local.panic_mode = parse_options_get_panic_mode(opts);
	local.screen_width = parse_options_get_screen_width(opts);
	local.allow_null = parse_options_get_allow_null(opts);
	local.use_cluster_disjuncts = parse_options_get_use_cluster_disjuncts(opts);
#ifdef USE_FAT_LINKAGES
	local.use_fat_links = parse_options_get_use_fat_links(opts);
	local.display_union = parse_options_get_display_union(opts);
#endif /* USE_FAT_LINKAGES */
	local.use_sat_solver = parse_options_get_use_sat_parser(opts);
	local.use_viterbi = parse_options_get_use_viterbi(opts);
	local.screen_width = parse_options_get_screen_width(opts);
	local.display_on = parse_options_get_display_on(opts);
	local.display_postscript = parse_options_get_display_postscript(opts);
	local.display_constituents = parse_options_get_display_constituents(opts);
	local.max_sentence_length = parse_options_get_max_sentence_length(opts);
	local.display_bad = parse_options_get_display_bad(opts);
	local.display_disjuncts = parse_options_get_display_disjuncts(opts);
	local.display_links = parse_options_get_display_links(opts);
	local.display_senses = parse_options_get_display_senses(opts);
	local.display_walls = parse_options_get_display_walls(opts);
}
示例#2
0
文件: parse.c 项目: IncorexLLC/Elchi
void process_linkage(Linkage linkage, Parse_Options opts) {
    char * string;
    int    j, mode, first_sublinkage;

    if (parse_options_get_display_union(opts)) {
	linkage_compute_union(linkage);
	first_sublinkage = linkage_get_num_sublinkages(linkage)-1;
    }
    else {
	first_sublinkage = 0;
    }

    for (j=first_sublinkage; j<linkage_get_num_sublinkages(linkage); ++j) {
	linkage_set_current_sublinkage(linkage, j);
	if (parse_options_get_display_on(opts)) {
	    string = linkage_print_diagram(linkage);
	    fprintf(stdout, "%s", string);
	    string_delete(string);
	}
	if (parse_options_get_display_links(opts)) {
	    string = linkage_print_links_and_domains(linkage);
	    fprintf(stdout, "%s", string);
	    string_delete(string);
	}
	if (parse_options_get_display_postscript(opts)) {
	    string = linkage_print_postscript(linkage, FALSE);
	    fprintf(stdout, "%s\n", string);
	    string_delete(string);
	}
    }
    if ((mode=parse_options_get_display_constituents(opts))) {
	string = linkage_print_constituent_tree(linkage, mode);
	if (string != NULL) {
	    fprintf(stdout, "%s\n", string);
	    string_delete(string);
	} else {
	    fprintf(stderr, "Can't generate constituents.\n");
	    fprintf(stderr, "Constituent processing has been turned off.\n");
	}
    }
}
示例#3
0
void put_opts_in_local_vars(Parse_Options opts) {
    local.verbosity = parse_options_get_verbosity(opts);
    local.timeout = parse_options_get_max_parse_time(opts);;
    local.memory = parse_options_get_max_memory(opts);;
    local.linkage_limit = parse_options_get_linkage_limit(opts);
    local.null_block = parse_options_get_null_block(opts);
    local.islands_ok = parse_options_get_islands_ok(opts);
    local.short_length = parse_options_get_short_length(opts);
    local.echo_on = parse_options_get_echo_on(opts);
    local.batch_mode = parse_options_get_batch_mode(opts);
    local.panic_mode = parse_options_get_panic_mode(opts);
    local.screen_width = parse_options_get_screen_width(opts);
    local.allow_null = parse_options_get_allow_null(opts);
    local.screen_width = parse_options_get_screen_width(opts);
    local.display_on = parse_options_get_display_on(opts);
    local.display_postscript = parse_options_get_display_postscript(opts);
    local.display_constituents = parse_options_get_display_constituents(opts);
    local.max_sentence_length = parse_options_get_max_sentence_length(opts);
    local.display_bad = parse_options_get_display_bad(opts);
    local.display_links = parse_options_get_display_links(opts);
    local.display_walls = parse_options_get_display_walls(opts);
    local.display_union = parse_options_get_display_union(opts);
}
示例#4
0
//##############################################################################################
static void process_linkage(Linkage linkage, Parse_Options opts,char * tmp_path,char * file_name)
//##############################################################################################

{
	char * string;
	int j, mode, first_sublinkage;
	int nlink;

	if (!linkage) return;  /* Can happen in timeout mode */

	if (parse_options_get_display_union(opts))
	{
		linkage_compute_union(linkage);
		first_sublinkage = linkage_get_num_sublinkages(linkage)-1;
	}
	else
	{
		first_sublinkage = 0;
	}

	nlink = linkage_get_num_sublinkages(linkage);
	for (j=first_sublinkage; j<nlink; ++j)
	{
		linkage_set_current_sublinkage(linkage, j);
		if (parse_options_get_display_on(opts))
		{
			string = linkage_print_diagram(linkage);
                     //########################################
//			fprintf(stdout, "%s", string);
 	            //######################################### 
			linkage_free_diagram(string);
		}
		if (parse_options_get_display_links(opts))
		{
			string = linkage_print_links_and_domains(linkage);
			fprintf(stdout, "%s", string);
			linkage_free_links_and_domains(string);
		}
		if (parse_options_get_display_senses(opts))
		{
			string = linkage_print_senses(linkage);
			fprintf(stdout, "%s", string);
			linkage_free_senses(string);
		}
		if (parse_options_get_display_disjuncts(opts))
		{
			string = linkage_print_disjuncts(linkage);
			fprintf(stdout, "%s", string);
			linkage_free_disjuncts(string);
		}
		if (parse_options_get_display_postscript(opts))
		{
			
                   //########################################################################
                        string = linkage_print_postscript(linkage, FALSE,tmp_path,file_name);
                   //                   fprintf(stdout, "%s\n", string);
                  //########################################################################
                        linkage_free_postscript(string);
                        /*string = linkage_print_postscript(linkage, FALSE);
			fprintf(stdout, "%s\n", string);
			linkage_free_postscript(string);*/
		}
	}
	if ((mode = parse_options_get_display_constituents(opts)))
	{
		string = linkage_print_constituent_tree(linkage, mode);
		if (string != NULL)
		{
                   /*###########################################*/
		//	fprintf(stdout, "%s\n", string);
		    /*##########################################*/
			linkage_free_constituent_tree_str(string);
		}
		else
		{
			fprintf(stderr, "Can't generate constituents.\n");
			fprintf(stderr, "Constituent processing has been turned off.\n");
		}
	}
}