lib/coh-metrix-port/metrics/count.rb
# Return a nicely formatted report on the sample, showing most the useful
# statistics about the text sample.
Return a nicely formatted report on the sample, showing most the useful
statistics about the text sample.
Return a nicely formatted report on the sample showing most the useful statistics about the text sample .
def report
      table = Terminal::Table.new(headings: ['Basic', 'Result']) do |t|
        t << ["Number of paragraphs", number_of_paragraphs]
        t << ["Number of sentences", number_of_sentences]
        t << ["Number of words", number_of_words]
        t << ["Number of characters", number_of_characters]
        t << ["Number of syllables", number_of_syllables]
        t << :separator
        t << ["Average words per sentence", mean_of_words_per_sentence]
        t << ["Average syllables per word", mean_of_syllables_per_word]
        t << ["Average syllables per content word", syllables_per_content_word]
        t << :separator
        t << ["Verbs Ocurrencies", verb_incidence]
        t << ["Nouns Ocurrencies", noun_incidence]
        t << ["Adjective Ocurrencies", adjective_incidence]
        t << ["Adverb Ocurrencies", adverb_incidence]
        t << ["Pronoun Ocurrencies", pronoun_incidence]
        t << ["Content Word Ocurrencies", content_word_incidence]
        t << ["Function Word Ocurrencies", function_word_incidence]
        t << :separator
        t << ["Flesch score", flesch]
      end
      puts table
    end
def report table = Terminal :: Table . new ( headings : [ 'Basic' , 'Result' ] ) do | t | t << [ "Number of paragraphs" , number_of_paragraphs ] t << [ "Number of sentences" , number_of_sentences ] t << [ "Number of words" , number_of_words ] t << [ "Number of characters" , number_of_characters ] t << [ "Number of syllables" , number_of_syllables ] t << :separator t << [ "Average words per sentence" , mean_of_words_per_sentence ] t << [ "Average syllables per word" , mean_of_syllables_per_word ] t << [ "Average syllables per content word" , syllables_per_content_word ] t << :separator t << [ "Verbs Ocurrencies" , verb_incidence ] t << [ "Nouns Ocurrencies" , noun_incidence ] t << [ "Adjective Ocurrencies" , adjective_incidence ] t << [ "Adverb Ocurrencies" , adverb_incidence ] t << [ "Pronoun Ocurrencies" , pronoun_incidence ] t << [ "Content Word Ocurrencies" , content_word_incidence ] t << [ "Function Word Ocurrencies" , function_word_incidence ] t << :separator t << [ "Flesch score" , flesch ] end puts table end
Return a nicely formatted report on the sample, showing most the useful
statistics about the text sample.
Return a nicely formatted report on the sample showing most the useful statistics about the text sample .