I have no clue. Here's the script so far and how it supposed to work:

stopwords = %w{the a by on for are with just but and to the me I has 
some in}
lines = File.readlines(ARGV[0])
line_count = lines.size
text = lines.join
total_characters = text.length
total_characters_nospaces = text.gsub(/\s+/,'').length
word_count = text.split.length
sentence_count = text.split(/\.|\?|!/).length
paragraph_count = text.split(/\n\n/).length
all_words = text.scan(/\w+/)
good_words = all_words.select{|word| !stopwords.include?(word)}
good_percentage = ((good_words.length.to_f / all_words.length.to_f) 
*100).to_i
sentences = text.gsub(/\s+/, ' ').strip.split(/\.|\?|!/)
sentences_sorted = sentences.sort_by {|sentence| sentence.length}
one_third = sentences_sorted.length/3
ideal_sentences = sentences_sorted.slice(one_third, one_third +1)
ideal_sentneces = ideal_sentences.select {|sentence| sentence =~ 
/is|are/}

puts "#{line_count} lines"
puts "#{total_characters} characters"
puts "#{total_characters_nospaces} characters (excluding spaces)"
puts "#{word_count} words"
# added Vowels in Text.(This part I added my self!!!! :))
puts "#{text.scan(/[aeiou]/).length} vowels in text."
puts "#{sentence_count} sentences"
puts "#{word_count / sentence_count} words per sentence (average)"
puts "#{paragraph_count} paragraph(s)"
puts "#{sentence_count / paragraph_count} sentences per paragraph 
(average)"
puts "#{good_percentage}% of word are non-fluff words"
puts "Summary: \n\n" + ideal_sentences.join(". ")
puts "--End of analysis."

-- 
Posted via http://www.ruby-forum.com/.