wimmuskee / readability-score Goto Github PK
View Code? Open in Web Editor NEWA Python library to calculate the readability score of a text.
License: GNU General Public License v2.0
A Python library to calculate the readability score of a text.
License: GNU General Public License v2.0
This is a readability calculator library for Python. You're able to calculate the readability of a text using several algorithms: - Flesch-Kincaid - Coleman-Liau - Dale-Chall - SMOG - Automated Readability Index - Flesch Reading Ease (does not have min_age) Dutch: - Flesch-Douma - KPC (AVI) All available calculators have a min_age property which describes the typical minimum age for a potential reader. Although the algorithms themselves might not be language independent, they can be called as such using a custom locale. This locale has to be available in the pyphen dependency. By default, the locale is set to 'en_GB'. Wim Muskee, 2012-2017 [email protected] License: GPL-2 # Dependencies - NLTK - Pyphen - Python, tested on 2.7 and 3.4 # Example: from readability_score.calculators.fleschkincaid import * from readability_score.calculators.dalechall import * fk = FleschKincaid(open('/tmp/text.txt').read(), locale='nl_NL') dc = DaleChall(open( '/tmp/text.txt' ).read(), simplewordlist=awordlist, locale='de_DE') print(fk.min_age) print(dc.min_age) # Tests Some tests are included with the library. I'am not sure how reactive the scores will be using different dependencies on other systems. This is not exact science, don't use these tests for anything important. cd readability_score python -m unittest discover -s test -v
To correctly determine the SMOG score, you need at least 30 sentences, where there are 10 consecutive of them taken from the beginning, the middle and the end of the text respectively.
Source: http://webpages.charter.net/ghal/SMOG_Readability_Formula_G._Harry_McLaughlin_(1969).pdf
Formatting isn't showing up properly.
Also good to have just one # & otherwise multiple ## or ### headings to be accessible.
I'm looking to be able to parse a URL for readability. I think the assumption in this library is that you have a text file. Is that correct?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.