// Unique.C
// (c) 1996 Burt Rosenberg

// Takes an input stream of texts and counts the 
// words that appear in the text. Uses two Objects: 
//    MyLine:   which gets and parses the input 
//              stream into words,
//    WordList: which keeps a linked list of
//              words with associated counts.

#include<iostream.h>
#include<stdlib.h>
#include "MyLine.h"
#include "WordList.h"

void main() {

   WordList wl ;
   MyLine ml ;

   const int size=100 ;
   char line[size] ;

   while ( ml.nextWord(line) ) {
      if ( wl.findWord( line ) ) wl.incrCount() ;
      else wl.addWord( line ) ; 
   }
   wl.print() ;
}

