function levenshtein_matrix_test ( )

%*****************************************************************************80
%
%% levenshtein_matrix_test() tests levenshtein_matrix().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 September 2022
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../levenshtein_matrix' );

  timestamp ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'levenshtein_matrix_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  levenshtein_matrix() computes the Levenshtein matrix\n' );
  fprintf ( 1, '  associated with the computation of the Levenshtein\n' );
  fprintf ( 1, '  distance between two strings.\n' );

  s = 'water';
  t = 'wine';
  d = levenshtein_matrix ( s, t );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  S = "%s"\n', s );
  fprintf ( 1, '  T = "%s"\n', t );
  for i = 0 : length ( s )
    for j = 0 : length ( t )
      fprintf ( 1, ' %2d', d(i+1,j+1) );
    end
    fprintf ( 1, '\n' );
  end

  s = 'sitting';
  t = 'kitten';
  d = levenshtein_matrix ( s, t );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  S = "%s"\n', s );
  fprintf ( 1, '  T = "%s"\n', t );
  for i = 0 : length ( s )
    for j = 0 : length ( t )
      fprintf ( 1, ' %2d', d(i+1,j+1) );
    end
    fprintf ( 1, '\n' );
  end

  s = 'sunday';
  t = 'saturday';
  d = levenshtein_matrix ( s, t );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  S = "%s"\n', s );
  fprintf ( 1, '  T = "%s"\n', t );
  for i = 0 : length ( s )
    for j = 0 : length ( t )
      fprintf ( 1, ' %2d', d(i+1,j+1) );
    end
    fprintf ( 1, '\n' );
  end

  s = 'pheromones';
  t = 'photographer';
  d = levenshtein_matrix ( s, t );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  S = "%s"\n', s );
  fprintf ( 1, '  T = "%s"\n', t );
  for i = 0 : length ( s )
    for j = 0 : length ( t )
      fprintf ( 1, ' %2d', d(i+1,j+1) );
    end
    fprintf ( 1, '\n' );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'levenshtein_matrix_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../levenshtein_matrix' );

  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

