Listing 2: The heart of main.cpp

typedef CThetaMatch<string> CTM;
CTM ctm( 256 );

CNearTree<string, CTM> Tree;

vector<string>::iterator is;
for ( iv=vBadText.begin( ); iv<vBadText.end( ); ++iv )
{
   if ( Tree.m_bfnNearestNeighbor ( ctm, 1000.0, result, *iv ) )
   {
      double dRadius = ctm.theta( result, *iv );
      cout << *iv ;
      long nFound = Tree.m_lfnFindInSphere
            ( ctm, max(1.3 * dRadius, .2), vResult, *iv );
      for ( is=vResult.begin( ); is<vResult.end( ); ++is )
         cout << "\t\t" << *is << endl;
   }
   else
      cout << "null for " << *iv << endl;
}
— End of Listing —