src/Generic/descriptors/NomPremodClassifier.cpp
// COPIED UNCHANGED FROM DESC CLASSIFIER 6/20/04
// utility function that inserts a score and type into a list of scores and types

COPIED UNCHANGED FROM DESC CLASSIFIER 6/20/04
utility function that inserts a score and type into a list of scores and types
COPIED UNCHANGED FROM DESC CLASSIFIER 6 / 20 / 04 utility function that inserts a score and type into a list of scores and types
int NomPremodClassifier::insertScore(double score, 
									   EntityType type, 
									   double scores[], 
									   EntityType types[], 
									   int size, int cap)
{
	bool inserted = false;
	int j, k;
	for (j=0; j<size; j++) {
		if(scores[j] < score) {
			if (size < cap)
				size++;
			for (k=size-1; k>j; k--){
				scores[k] = scores[k-1];
				types[k] = types[k-1];
			}
			scores[j] = score;
			types[j] = type;
			inserted = true;
			break;
		}
	}
	if (!inserted) {
		if (size < cap) {
			scores[size] = score;
			types[size++] = type;
		}
	}
	return size;
}
int NomPremodClassifier :: insertScore ( double score , EntityType type , double scores [ ] , EntityType types [ ] , int size , int cap ) { bool inserted = false ; int j , k ; for ( j = 0 ; j < size ; j ++ ) { if ( scores [ j ] < score ) { if ( size < cap ) size ++ ; for ( k = size - 1 ; k > j ; k -- ) { scores [ k ] = scores [ k - 1 ] ; types [ k ] = types [ k - 1 ] ; } scores [ j ] = score ; types [ j ] = type ; inserted = true ; break ; } } if ( ! inserted ) { if ( size < cap ) { scores [ size ] = score ; types [ size ++ ] = type ; } } return size ; }
COPIED UNCHANGED FROM DESC CLASSIFIER 6/20/04
utility function that inserts a score and type into a list of scores and types
COPIED UNCHANGED FROM DESC CLASSIFIER 6 / 20 / 04 utility function that inserts a score and type into a list of scores and types
// insert and shift remaining
 // add on end or ignore
