コード例 #1
0
int main(){

	//Test KthIndexFromEnd 

	//TestNumbertoStr

	//removeSpaces

	//StrWordsinRev

	//commonWords
	char str1[10] = "ravi is", str2[10] = "good am";
	//char **p = commonWords(str1, str2);
	printf("\n%u", commonWords(str1, str2));

	return 0;
}
コード例 #2
0
int main(){

	//Test KthIndexFromEnd 
	
	//TestNumbertoStr

	//removeSpaces

	//StrWordsinRev

	//commonWords
	char *str1 = "       ";
	char *str2 = " who what";

	char **res = commonWords(str1, str2);

	return 0;
}
コード例 #3
0
void AbstractTwoLevelAgreement::overLapNamesFinished(const SelectionList & tagWords, const SelectionList & outputWords,int &numWords) {
    if (tagWords.size()==0 && outputWords.size()==0 )
        return;
    bool underComputation=(&numWords==&underNumWords);
    int countCommon=commonWords(text,tagWords,outputWords); //not working correctly on maximal boundaries
    int countCorrect=countWords(text,tagWords);
    int countDetected=countWords(text,outputWords);
    assert (countCorrect!=0);
    assert (countDetected!=0);
    numWords+=countCorrect;
    double	recall=(double)countCommon/countCorrect * countCorrect,
            precision=(double)countCommon/countDetected *countCorrect;
    if (countDetected==0)
        precision=0;
    if (underComputation) {
        underBoundaryRecallList.append(recall);
        underBoundaryPrecisionList.append(precision);
    } else {
        boundaryRecallList.append(recall);
        boundaryPrecisionList.append(precision);
    }
}