link-grammar-5.8.0/link-grammar/parse/fast-match.c
/**
 * Print statistics on various connector matching aspects.
 * A summary can be found by the shell commands:
 * link-parser < file.batch | grep match_stats: | sort | uniq -c
 */
Print statistics on various connector matching aspects.
A summary can be found by the shell commands:
link-parser < file.batch | grep match_stats: | sort | uniq -c
Print statistics on various connector matching aspects . A summary can be found by the shell commands : link - parser < file . batch | grep match_stats : | sort | uniq - c
static void match_stats(Connector *c1, Connector *c2)
{
	if (NULL == c1) printf("match_stats: cache\n");
	if (NULL == c2) return;
	if ((1 == c1->uc_start) && (1 == c2->uc_start) &&
	    (c1->string[0] == c2->string[0]))
	{
		printf("match_stats: h/d mismatch\n");
	}
	if (0 == c1->lc_start) printf("match_stats: no lc (c1)\n");
	if (0 == c2->lc_start) printf("match_stats: no lc (c2)\n");
	if (string_set_cmp(c1->string, c2->string)) printf("match_stats: same\n");
	const char *a = &c1->string[c1->lc_start];
	const char *b = &c2->string[c2->lc_start];
	do
	{
		if (*a != *b && (*a != '*') && (*b != '*')) printf("match_stats: lc false\n");
		a++;
		b++;
	} while (*a != '\0' && *b != '\0');
	printf("match_stats: lc true\n");
}
static void match_stats ( Connector * c1 , Connector * c2 ) { if ( NULL == c1 ) printf ( " \n " ) ; if ( NULL == c2 ) return ; if ( ( 1 == c1 -> uc_start ) && ( 1 == c2 -> uc_start ) && ( c1 -> string [ 0 ] == c2 -> string [ 0 ] ) ) { printf ( " \n " ) ; } if ( 0 == c1 -> lc_start ) printf ( " \n " ) ; if ( 0 == c2 -> lc_start ) printf ( " \n " ) ; if ( string_set_cmp ( c1 -> string , c2 -> string ) ) printf ( " \n " ) ; const char * a = & c1 -> string [ c1 -> lc_start ] ; const char * b = & c2 -> string [ c2 -> lc_start ] ; do { if ( * a != * b && ( * a != ' ' ) && ( * b != ' ' ) ) printf ( " \n " ) ; a ++ ; b ++ ; } while ( * a != ' \0 ' && * b != ' \0 ' ) ; printf ( " \n " ) ; }
Print statistics on various connector matching aspects.
Print statistics on various connector matching aspects .