Information Retrieval & Computational Geometry
by D. Ryan Stephens

Listing One
while (reader.Read())
{
   for (int j = 0; j < reader.FieldCount; j++)
   {
      name = reader.GetName( j );
      val  = reader.GetValue( j ).ToString();
      key  = name + "|" + val;

      idxDict = dict.IndexOf( key );

      if (idxDict < 0)
      {
         idxDict = dict.Add( key );
         doc.Insert( idxDict, 1 );
      }
      else
      {
         idxKey  = dict.IndexOf( key );
         freq    = (int)doc[idxKey];
         freq++;
         doc[idxKey] = freq;
      }
   }
}









1


