cadmium_readability
Version, currently master branch1 version
- master branchlatestOct 28, 2020
github.com/cadmiumcr/readability
Analyze text and determine it's readability using various algorithms
1 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
cadmium_readability:
github: cadmiumcr/readability
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.35.1- License
- MIT
- Authors
- Chris Watson, Rémy Marronnier
Dependencies
Runtime Dependencies
- cadmium_tokenizer*github: cadmiumcr/tokenizer
README
Cadmium::Readability
Analyze blocks of text and determine, using various algorithms, the readability of the text.
Installation
-
Add the dependency to your
shard.yml:dependencies: cadmium_readability: github: cadmiumcr/readability -
Run
shards install
Usage
require "cadmium_readability"
text = <<-EOF
After marriage, the next big event in the couples lives will be their honeymoon. It is a time when the newly weds can get away from relatives and friends to spend some significant time getting to know one another. This time alone together that the couple shares is called the honeymoon. A great gift idea for the married couple would be to give them a surprise tour package. Most women would like to go on a honeymoon.
The week or two before the ceremonies would be the best time to schedule a tour because then the budget for this event could be considered. In winter there are more opportunities for the couple to get close to one another because of the cold weather. It is easier to snuggle when the weather is not favorable to outdoor activities. This would afford the couple ample time to know more about themselves during the honeymoon.
Honeymoon plans should be discussed with the wife to ensure that the shock is pleasant and not a negative experience to her. It is also a good idea in this case, to ask her probing questions as to where she would like to go. Perhaps you could get a friend or family member to ask her what would be her favorite travel location. That would ensure that you know just what she is looking for.
Make sure that the trip is exactly what she wants. Then on the wedding night tell her about the adventure so that the needed accommodations can be made.
EOF
report = Cadmium::Readability.report.new(text)
puts report.grade_levels.flesch # => 71.47176470588238
puts report.grade_levels.gunning_fog # => 10.721568627450981
puts report.grade_levels.kincaid # => 7.513725490196077
Contributing
- Fork it (https://github.com/cadmiumcr/cadmium_readability/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Chris Watson - creator and maintainer
- Rémy Marronnier - core contributor
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Oct 28, 2020
- Crystal
0.35.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/cadmiumcr/readability
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1