src/Arabic/trainers/ar_HeadFinder.cpp
// priority_scan searches go through the tags in "set" one by one to see if
//		they match the elements in right[]
// scan searches go through the elements of right[] one by one to see if
//		they match any of the tags in "set"
//
// i.e. in priority_scan, the order of the tags in the set matters,
//   and in scan it doesn't
//
// left_to_right / right_to_left obviously refers to the order in which it
//   searches through the elements of right[], a.k.a. the children 
//   of the node whose head we're trying to find

priority_scan searches go through the tags in "set" one by one to see if
they match the elements in right[]
scan searches go through the elements of right[] one by one to see if
they match any of the tags in "set"



left_to_right / right_to_left obviously refers to the order in which it
searches through the elements of right[], a.k.a. the children
of the node whose head we're trying to find
priority_scan searches go through the tags in " set " one by one to see if they match the elements in right [] scan searches go through the elements of right [] one by one to see if they match any of the tags in " set " left_to_right / right_to_left obviously refers to the order in which it searches through the elements of right [] a . k . a . the children of the node whose head we ' re trying to find
int ArabicHeadFinder::scan_from_left_to_right_by_set (Symbol* set, int size)
{
	for (int j = 0; j < size; j++){
		for (int k = 0; k < production.number_of_right_side_elements; k++){
			if (production.right[k] == set[j])
				return k;
		}
	}
	return -1;
}
int ArabicHeadFinder :: scan_from_left_to_right_by_set ( Symbol * set , int size ) { for ( int j = 0 ; j < size ; j ++ ) { for ( int k = 0 ; k < production . number_of_right_side_elements ; k ++ ) { if ( production . right [ k ] == set [ j ] ) return k ; } } return -1 ; }
priority_scan searches go through the tags in "set" one by one to see if
they match the elements in right[]
scan searches go through the elements of right[] one by one to see if
they match any of the tags in "set"
priority_scan searches go through the tags in " set " one by one to see if they match the elements in right [] scan searches go through the elements of right [] one by one to see if they match any of the tags in " set "