No commit activity in last 3 years
No release in over 3 years
Text readability indexes and stats calibrated on Italian language. Inspired by Lingua::EN::Readability and the original Perl module Lingua::EN::Fathom. It prints some usefull readability stats including sentences, words, syllables and average values for words and sentences. Gulpease and Flesch for italian text is calculated.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.11
~> 10.0
~> 3.0
 Project Readme

Build Status Gem Version

Lingua::It::Readability

Inspired by Lingua::EN::Readability and his perl original version Lingua::EN::Fathom, a gem focused on readability of Italian language texts.

Installation

Add this line to your application's Gemfile:

gem 'lingua-it-readability'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lingua-it-readability

Usage

require 'lingua/it/readability'

text   = 'Testo campione da analizzare con Gulpease e Flesch tarati su lingua Italiana.'
report = Lingua::IT::Readability.new(text)
report.num_sentences # 1
report.num_words     # 12
report.num_syllables # 29
report.syllables     # array containing all 29 syllables => ['Te', 'sto', 'cam', 'pio', 'ne', ... ,]
report.sentences     # array containing all sentences => [...]
report.words         # array containing all words => ['Testo', 'campione', 'da', 'analizzare', ... ,]
report.gulpease      # 59
report.flesch        # 36.92
report.report        # a formatted summary of statistics and measures

# accept custom symbols as delimiters
text = "Lista:\n- Gennaio;\n- Febbraio;"
report = Lingua::IT::Readability.new(text, ':', '-')
report.num_sentences # 3
report.num_words     # 3
report.num_syllables # 8
report.report        # a formatted summary of statistics and measures

# It's also possible to not directly initialize the object..
text = "Lista:\n- Gennaio;\n- Febbraio;"
report = Lingua::IT::Readability.new
# ..using method analyze with optional delimiters
report.analyze(text, ':', ';')
report.num_sentences # 3
report.num_words     # 3
report.num_syllables # 8
report.report        # a formatted summary of statistics and measures

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Changelog

See the CHANGELOG file.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/codepr/lingua-it-readability.

License

The gem is available as open source under the terms of the MIT License.