link-grammar-5.8.0/link-grammar/api.c
/**
 * Create and initialize a Parse_Options object
 */
Create and initialize a Parse_Options object
Create and initialize a Parse_Options object
Parse_Options parse_options_create(void)
{
	Parse_Options po;
	init_memusage();
	po = (Parse_Options) malloc(sizeof(struct Parse_Options_s));
	verbosity = po->verbosity = 1;
	debug = po->debug = (char *)"";
	test = po->test = (char *)"";
	po->disjunct_cost = 2.7;
	po->min_null_count = 0;
	po->max_null_count = 0;
	po->islands_ok = false;
	po->use_sat_solver = false;
	po->linkage_limit = 100;
#if defined HAVE_HUNSPELL || defined HAVE_ASPELL
	po->use_spell_guess = 7;
#else
	po->use_spell_guess = 0;
#endif 
	po->cost_model.compare_fn = &VDAL_compare_parse;
	po->cost_model.type = VDAL;
	po->short_length = 16;
	po->all_short = false;
	po->perform_pp_prune = true;
	po->twopass_length = 30;
	po->repeatable_rand = true;
	po->resources = resources_create();
	po->display_morphology = true;
	po->dialect = (dialect_info){ .conf = strdup("") };
	return po;
}
Parse_Options parse_options_create ( void ) { Parse_Options po ; init_memusage ( ) ; po = ( Parse_Options ) malloc ( sizeof ( struct Parse_Options_s ) ) ; verbosity = po -> verbosity = 1 ; debug = po -> debug = ( char * ) " " ; test = po -> test = ( char * ) " " ; po -> disjunct_cost = 2.7 ; po -> min_null_count = 0 ; po -> max_null_count = 0 ; po -> islands_ok = false ; po -> use_sat_solver = false ; po -> linkage_limit = 100 ; #if defined HAVE_HUNSPELL || defined HAVE_ASPELL po -> use_spell_guess = 7 ; #else po -> use_spell_guess = 0 ; #endif po -> cost_model . compare_fn = & VDAL_compare_parse ; po -> cost_model . type = VDAL ; po -> short_length = 16 ; po -> all_short = false ; po -> perform_pp_prune = true ; po -> twopass_length = 30 ; po -> repeatable_rand = true ; po -> resources = resources_create ( ) ; po -> display_morphology = true ; po -> dialect = ( dialect_info ) { . conf = strdup ( " " ) } ; return po ; }
Create and initialize a Parse_Options object
Create and initialize a Parse_Options object
/* Here's where the values are initialized */ /* The parse_options_set_(verbosity|debug|test) functions set also the
	 * corresponding global variables. So these globals are initialized
	 * here too. */ /* A cost of 2.7 allows the usual cost-2 connectors, plus the
	 * assorted fractional costs, without going to cost 3.0, which
	 * is used only during panic-parsing.
	 * XXX In the long run, this should be fetched from the dictionary
	 * (and should probably not be a parse option).
	 */ /* defined HAVE_HUNSPELL || defined HAVE_ASPELL */