clearnote01/readability
clearnote01/readability has 81 GitHub stars and 14 forks. GitHot measured 0 stars in 24 hours, 0 in 7 days, and 0 in 15 days. Last checked 2026-11-12 08:38 UTC. Last push 2025-03-06.
npm package to calculate readability statistics of a text object - paragraphs, sentences, articles.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originaltext-readability
npm package to calculate statistics from text to determine readability, complexity and grade level of a particular corpus.
A rewrite of textstat library in JS
Usage
install required packages with npm install text-readability
>>> import rs from 'text-readability';
>>> const testData = `
Playing games has always been thought to be important to
the development of well-balanced and creative children;
however, what part, if any, they should play in the lives
of adults has never been researched that deeply. I believe
that playing games is every bit as important for adults
as for children. Not only is taking time out to play games
with our children and other adults valuable to building
interpersonal relationships but is also a wonderful way
to release built up tension. `
>>> rs.fleschReadingEase(testData)
>>> rs.fleschKincaidGrade(testData)
>>> rs.colemanLiauIndex(testData)
>>> rs.automatedReadabilityIndex(testData)
>>> rs.daleChallReadabilityScore(testData)
>>> rs.difficultWords(testData)
>>> rs.linsearWriteFormula(testData)
>>> rs.gunningFog(testData)
>>> rs.textStandard(testData)
The argument (text) for all the defined functions remains the same - i.e the text for which statistics need to be calculated.
Install using npm
npm install text-readability
List of Functions
Syllable Count
rs.syllableCount(text, lang='en-US')
Returns the number of syllables present in the given text.
Uses the npm module syllable
for syllable calculation. lang currently only used for proper lowercasing
Should be passed to syllable or write own library for this
Lexicon Count
rs.lexiconCount(text, removePunctuation=true)
Calculates the number of words present in the text.
Optional removePunctuation specifies whether we need to take
punctuation symbols into account while counting lexicons.
Default value is true, which removes the punctuation
before counting lexicon items.
Sentence Count
rs.sentenceCount(text)
Returns the number of sentences present in the given text.
The Flesch Reading Ease formula
rs.fleschReadingEase(text)
Returns the Flesch Reading Ease Score.
The following table can be helpful to assess the ease of readability in a document.
The table is an example of values. While the maximum score is 121.22, there is no limit on how low the score can be. A negative score is valid.
| Score | Difficulty |
|---|---|
| 90-100 | Very Easy |
| 80-89 | Easy |
| 70-79 | Fairly Easy |
| 60-69 | Standard |
| 50-59 | Fairly Difficult |
| 30-49 | Difficult |
| 0-29 | Very Confusing |
Further reading on Wikipedia
The Flesch-Kincaid Grade Level
rs.fleschKincaidGrade(text)
Returns the Flesch-Kincaid Grade of the given text. This is a grade formula in that a score of 9.3 means that a ninth grader would be able to read the document.
Further reading on Wikipedia
The Fog Scale (Gunning FOG Formula)
rs.gunningFog(text)
Returns the FOG index of the given text. This is a grade formula in that a score of 9.3 means that a ninth grader would be able to read the document.
Further reading on Wikipedia
The SMOG Index
rs.smogIndex(text)
Returns the SMOG index of the given text. This is a grade formula in that a score of 9.3 means that a ninth grader would be able to read the document.
Texts of fewer than 30 sentences are statistically invalid, because the SMOG formula was normed on 30-sentence samples. textstat requires atleast 3 sentences for a result.
Further reading on Wikipedia
Automated Readability Index
rs.automatedReadabilityIndex(text)
Returns the ARI (Automated Readability Index) which outputs a number that approximates the grade level needed to comprehend the text.
For example if the ARI is 6.5, then the grade level to comprehend the text is 6th to 7th grade.
Further reading on Wikipedia
The Coleman-Liau Index
rs.colemanLiauIndex(text)
Returns the grade level of the text using the Coleman-Liau Formula. This is a grade formula in that a score of 9.3 means that a ninth grader would be able to read the document.
Further reading on Wikipedia
Linsear Write Formula
rs.linsearWriteFormula(text)
Returns the grade level using the Linsear Write Formula. This is a grade formula in that a score of 9.3 means that a ninth grader would be able to read the document.
Further reading on Wikipedia
Dale-Chall Readability Score
rs.daleChallReadabilityScore(text)
Different from other tests, since it uses a lookup table of the most commonly used 3000 English words. Thus it returns the grade level using the New Dale-Chall Formula.
| Score | Understood by |
|---|---|
| 4.9 or lower | average 4th-grade student or lower |
| 5.0–5.9 | average 5th or 6th-grade student |
| 6.0–6.9 | average 7th or 8th-grade student |
| 7.0–7.9 | average 9th or 10th-grade student |
| 8.0–8.9 | average 11th or 12th-grade student |
| 9.0–9.9 | average 13th to 15th-grade (college) student |
Further reading on Wikipedia
Readability Consensus based upon all the above tests
rs.textStandard(text, float_output=False)
Based upon all the above tests, returns the estimated school grade level required to understand the text.
Optional float_output allows the score to be returned as a
float. Defaults to false.
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,560 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,830 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,395 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,473 스타