void mue::Seen_table::add_meeting(Team_id id_1, Team_id id_2, Team_id id_3) noexcept
{
	_update_table(id_1, id_2, id_3);
	_update_table(id_2, id_3, id_1);
	_update_table(id_3, id_1, id_2);
}
Ejemplo n.º 2
0
int
main( int argc, char *argv[] )
{
   char       *h1, *h2, *s, *q;
   unsigned    i;
   unsigned    n;
   struct options *o = options_new(  );
   struct fqreader *z;

   /* Get the command line options */
   options_cmdline( o, argc, argv );

   words = tokenset_new(  );
   word = realloc( word, sizeof ( char ) * ( 1 + o->word_size ) );

   if ( o->optind == argc ) {                    /* read from stdin */

      z = fqreader_new( NULL );

      while ( fqreader_next( z, &h1, &h2, &s, &q ) ) {
         stru_toupper( s );
         _update_table( o->word_size, s, o->check_initial );
      }

      fqreader_free( z );
   }

   else {                                        /* read from input files */
      int         k;

      for ( k = o->optind; k < argc; k++ ) {

         z = fqreader_new( argv[k] );

         if ( _IS_NULL( z ) ) {
            fprintf( stderr, "[ERROR] %s: Cannot open input file \"%s\"\n", _I_AM, argv[k] );
            exit( 1 );
         }

         while ( fqreader_next( z, &h1, &h2, &s, &q ) ) {
            stru_toupper( s );
            _update_table( o->word_size, s, o->check_initial );
         }

         fqreader_free( z );
      }
   }

   /* Print the countlist */

   n = tokenset_count( words );

   for ( i = 0; i < n; i++ ) {
      if ( countlist[i].count < o->min_count )
         continue;
      printf( "%s\t%d\n", tokenset_get_by_id( words, countlist[i].id ), countlist[i].count );
   }

   options_free( o );
   tokenset_free( words );
   _FREE( word );
   _FREE( countlist );

   return 0;
}