git://www.github.com/mmautner/readability.git
git clone http://www.github.com/mmautner/readability
$ svn co --depth empty http://www.github.com/mmautner/readability
Checked out revision 1.
$ cd repo
$ svn up trunk
用来测量给定正文的可读性的函数集合。 我建议核对一下维基百科文章below--most的评估级别所需的级别级别。
shell$ pip install nltk
shell$ python
>>import nltk
>>nltk.download('punkt')
演示:
shell$ python readability.py
Test text:
"We are close to wrapping up our 10 week Rails Course. This week we will cover a handful of topics commonly encountered in Rails projects. We then wrap up with part 2 of our Reddit on Rails exercise! By now you should be hard at work on your personal projects. The students in the course just presented in front of the class with some live demos and a brief intro to to the problems their app were solving. Maybe set aside some time this week to show someone your progress, block off 5 minutes and describe what goal you are working towards, the current state of the project (is it almost done, just getting started, needs UI, etc.), and then show them a quick demo of the app. Explain what type of feedback you are looking for (conceptual, design, usability, etc.) and see what they have to say. As we are wrapping up the course you need to be focused on learning as much as you can, but also making sure you have the tools to succeed after the class is over."
ARI: 7.2164516129
FleschReadingEase: 88.9553
FleschKincaidGradeLevel: 5.3235
GunningFogIndex: 9.1355
SMOGIndex: 8.19615242271
ColemanLiauIndex: 6.7804
LIX: 35.2666666667
RIX: 3.1
readability.py 中包含以下可读性度量指标:
从以下方面大幅提升:
https://github.com/nltk/nltk_contrib/tree/master/nltk_contrib/readability
烟雾指数表现得最准确。