function jaccard_distance_test ( )

%*****************************************************************************80
%
%% jaccard_distance_test() tests jaccard_distance().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    14 November 2023
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../jaccard_distance' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'jaccard_distance_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  jaccard_distance() computes the jaccard distance\n' );
  fprintf ( 1, '  between two sets.\n' );

  A = [ 'a', 'e', 'i', 'o', 'u', 'y' ];
  B = [ 'a', 'l', 'i', 'g', 't', 'o', 'r' ];
  d = jaccard_distance ( A, B );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  A:\n' );
  disp ( A );
  fprintf ( 1, '  B:\n' );
  disp ( B );
  fprintf ( 1, '  Computed distance = %g\n', d );
%
%  Repeated elements are ignored.
%
  A = [ 'a', 'e', 'i', 'o', 'u', 'y' ];
  B = [ 'a', 'l', 'l', 'i', 'g', 'a', 't', 'o', 'r' ];
  d = jaccard_distance ( A, B );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  A:\n' );
  disp ( A );
  fprintf ( 1, '  B:\n' );
  disp ( B );
  fprintf ( 1, '  Computed distance = %g\n', d );
%
%  Can specify sets as strings.
%
  A = [ 'a', 'e', 'i', 'o', 'u', 'y' ];
  B = [ 'crwth' ];
  d = jaccard_distance ( A, B );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  A:\n' );
  disp ( A );
  fprintf ( 1, '  B:\n' );
  disp ( B );
  fprintf ( 1, '  Computed distance = %g\n', d );
%
%  Can specify sets as strings.
%
  A = [ 'a', 'e', 'i', 'o', 'u', 'y' ];
  B = [ 'a', 'e', 'i', 'o', 'u', 'y' ];
  d = jaccard_distance ( A, B );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  A:\n' );
  disp ( A );
  fprintf ( 1, '  B:\n' );
  disp ( B );
  fprintf ( 1, '  Computed distance = %g\n', d );
%
%  Can specify sets as strings.
%
  A = [ 'a', 'e', 'i', 'o', 'u', 'y' ];
  B = [ 'adieu' ];
  d = jaccard_distance ( A, B );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  A:\n' );
  disp ( A );
  fprintf ( 1, '  B:\n' );
  disp ( B );
  fprintf ( 1, '  Computed distance = %g\n', d );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'jaccard_distance_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../jaccard_distance' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

