Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use readability

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to use readability". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Readability text readability formulas were originally developed for English, so currently only English text data is supported.

Install pip install readability

Looking in indexes: https://mirrors.aliyun.com/pypi/simple/

Collecting readability

Downloading https://mirrors.aliyun.com/pypi/packages/26/70/6f8750066255d4d2b82b813dd2550e0bd2bee99d026d14088a7b977cd0fc/readability-0.3.1.tar.gz (34 kB)

Building wheels for collected packages: readability

Building wheel for readability (setup.py)... [? 25ldone

[? 25h Created wheel for readability: filename=readability-0.3.1-py3-none-any.whl size=35459 sha256=e920a8d6510bd1211df79a944ff03c94f2fea220ae4e5f430e930a52d75595ee

Stored in directory: / Users/thunderhit/Library/Caches/pip/wheels/90/29/a7/726a69748065b8c306b4a935ac2c57e9bc492cb23f355c8e03

Successfully built readability

Installing collected packages: readability

Successfully installed readability-0.3.1

Get started with import readability quickly

Text = 'Note that tokens are separated by spaces and sentences by newlines.'

Results = readability.getmeasures (text, lang='en')

Results

OrderedDict (('readability grades')

OrderedDict ('Kincaid', 7.442500000000003)

('ARI', 5.825624999999999)

('Coleman-Liau', 9.532550312500003)

('FleschReadingEase', 55.95250000000002)

('GunningFogIndex', 10.70000000000000001)

('LIX', 39.25)

('SMOGIndex', 9.70820393249937)

('RIX', 2.5)

('DaleChallIndex', 9.9545500000001)]))

('sentence info'

OrderedDict (('characters_per_word', 4.9375))

('syll_per_word', 1.6875)

('words_per_sentence', 8.0)

('sentences_per_paragraph', 2.0)

('type_token_ratio', 0.9375)

('characters', 79)

('syllables', 27)

('words', 16)

('wordtypes', 15)

('sentences', 2)

('paragraphs', 1)

('long_words', 5)

('complex_words', 3)

('complex_words_dc', 6)]))

('word usage'

OrderedDict (['tobeverb', 2)

('auxverb', 0)

('conjunction', 1)

('pronoun', 2)

('preposition', 2)

('nominalization', 1)]))

('sentence beginnings'

OrderedDict (['pronoun', 1)

('interrogative', 0)

('article', 0)

('subordination', 0)

('conjunction', 0)

('preposition', 0)])]))

The information returned includes

Readability grades readability indicator sentence info sentence information word usage words use sentence beginnings sentence beginning readability indicator results ['readability grades']

OrderedDict ('Kincaid', 7.442500000000003)

('ARI', 5.825624999999999)

('Coleman-Liau', 9.532550312500003)

('FleschReadingEase', 55.95250000000002)

('GunningFogIndex', 10.70000000000000001)

('LIX', 39.25)

('SMOGIndex', 9.70820393249937)

('RIX', 2.5)

('DaleChallIndex', 9.954550000000001)) readability Kincaid indicator results [' readability grades'] ['Kincaid'] 7.4425000000003

That's all for the content of "how to use readability". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report