forked from wimmuskee/readability-score
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
41 lines (27 loc) · 1.07 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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 as a myspell dictionary. By default, the locale is set to 'en_GB'.
Wim Muskee, 2012-2013
wimmuskee@gmail.com
License: GPL-2
# Dependencies
- NLTK
- python-hyphenator
- myspell dictionary in your language
# 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