示例#1
0
void initialize_util_module() {
    initialize_debug();
    initialize_trace();
    initialize_serializer();
    initialize_thread();
    initialize_ascii();
    initialize_thread_script_state();
    initialize_script_state();
    initialize_name();
    initialize_name_generator();
    initialize_lean_path();
}
示例#2
0
/* manip()-27 statements */
void 
manip(char str[],char query[],
	  int count_l,ranker_t ranked_lines[])
{  
	int debug[MAX_QLEN][MAX_QLEN],i=0,j=0,bytes=0;
	double max_count=0.0,score=0.0,count_same=0.0;
	char changed_q[STR_SIZE];
	bytes=strlen(str);
	
	strcpy(changed_q,"");
	compute_changed_query(query,changed_q);
	initialize_debug(debug,changed_q);
	
	for(i=0;str[i]!='\0';i++)
	{
		/* So that no new lines are printed when the line is empty */
		if(i==0&&str[i]!='\0') 
		{
			printf("\n");
		}
		
		printf("%c",str[i]);
		
		for(j=0;query[j]!='\0';j++)
		{
			/* Checking each str and query combination */
			count_same=stage2_score(i,j,str,query); 
			
			/* Highest score for each line determined */
			if(max_count<count_same)
			{
				max_count=count_same;
			}
			
			/* Computing the debugging array for S4 */
			compute_debug(i,j,str,changed_q,debug);
		}		
	}
	
	/* Printing only non-empty lines */
	if(bytes!=0) 
	{
		printf("\nS1: line %5d, bytes =%3d\n",count_l,bytes);
		printf("S2: line %5d, score =%7.3f",count_l,max_count);
		printf("\n");
		
		#if(DEBUG==1) /*Only printing debugger when debug is 1*/
		{
			print_debug(debug,changed_q);
		}
		#endif
		
		/* Computing S4 score */
		score=compute_score(debug,bytes,changed_q);
		printf("S4: line %5d, score =%7.3f\n",count_l,score);
		
		/* Ranking the line and storing it if required */
		rank_lines(ranked_lines,str,score,count_l);
		printf("---");
	}
	return;
}