Esempio n. 1
0
double Overlap(Definition &def1, Definition &def2)
{
	int numShareWord = def1.Overlap(def2);
#ifdef I_AM_PARANOIK
	int as = def1.wordCount + def2.wordCount;
	if (!as)
		return 0;
	return numShareWord/((double)as);
#else
	return numShareWord/((double)(def1.wordCount + def2.wordCount));
#endif
}
Esempio n. 2
0
double Karaulov(Definition &def1, Definition &def2)
{
	std::set<unsigned long long> overlapDef;
	std::set<unsigned long long>::iterator it;

	int numShareWord = def1.Overlap(def2,overlapDef);

	if(numShareWord >= globalArgs.T1)
		return 1;

	if(numShareWord >= globalArgs.T2)
	{
		for( it=overlapDef.begin(); it != overlapDef.end(); ++ it )
		{
			if ( karaulov_set.find(*it) == karaulov_set.end() )
				return 0;
		}
		return 1;
	}

	return 0;
}