function cdf = english_word_length_cdf ( x )

%*****************************************************************************80
%
%% ENGLISH_WORD_LENGTH_CDF evaluates the English Word Length CDF.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    31 July 2006
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Henry Kucera, Winthrop Francis,
%    Computational Analysis of Present-Day American English,
%    Brown University Press, 1967.
%
%  Parameters:
%
%    Input, integer X, the word length whose CDF is desired.
%
%    Output, real CDF, the value of the CDF.
%
  word_length_max = 27;

  pdf_vec = [ ...
    0.03160, ...
    0.16975, ...
    0.21192, ...
    0.15678, ...
    0.10852, ...
    0.08524, ...
    0.07724, ...
    0.05623, ...
    0.04032, ...
    0.02766, ...
    0.01582, ...
    0.00917, ...
    0.00483, ...
    0.00262, ...
    0.00099, ...
    0.00050, ...
    0.00027, ...
    0.00022, ...
    0.00011, ...
    0.00006, ...
    0.00005, ...
    0.00002, ...
    0.00001, ...
    0.00001, ...
    0.00001, ...
    0.00001, ...
    0.00001 ];
  pdf_sum = 0.99997;

  if ( x < 1 )
    cdf = 0.0;
  elseif ( x < word_length_max )
    cdf = sum ( pdf_vec(1:x) ) / pdf_sum;
  elseif ( word_length_max <= x )
    cdf = 1.0;
  end

  return
end
