Skip to content

Commit 74b67ba

Browse files
committed
docs: add See It in Action section with formula comparison table
1 parent f3546f2 commit 74b67ba

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,54 @@ ReadSightPy measures text readability across **86 languages** using **17 readabi
1313

1414
This is a Python port of [ReadSight](https://github.com/MADEVAL/ReadSight) (PHP).
1515

16+
## See It in Action
17+
18+
Two texts of almost equal length — a plain sentence and a chunk of legal boilerplate:
19+
20+
```python
21+
from readsight import ReadSight
22+
23+
plain = "We made an app that reads your text. It tells you how easy it is to read. You get a score in one second."
24+
legal = "The parties acknowledge that any unauthorized disclosure of confidential information may cause irreparable harm. In such an event, the affected party shall be entitled to seek injunctive relief."
25+
```
26+
27+
There is no "score everything" call — you loop over the formulas the language supports and call `score()` for each:
28+
29+
```python
30+
rs = ReadSight("en-us")
31+
32+
for formula in rs.get_supported_formulas():
33+
result = rs.score(formula, legal)
34+
# result.score, result.grade_level, result.interpretation
35+
...
36+
```
37+
38+
For both texts that produces:
39+
40+
```text
41+
+---------------------------+-------------------------+----------------------------+
42+
| READABILITY FORMULA | Plain text | Legalese |
43+
+---------------------------+-------------------------+----------------------------+
44+
| Flesch Reading Ease | 107.1 Very Easy | 23.4 Very Hard |
45+
| Flesch-Kincaid Grade | 0.3 g0.3 1st Grade | 13.5 g13.5 College |
46+
| Gunning Fog | 3.2 g3.2 Very Easy | 18.5 g18.5 Extremely Hard|
47+
| SMOG Index | 3.1 g3.1 3rd Grade | 15.2 g15.2 College |
48+
| Coleman-Liau | -0.4 g0.0 Kindergarten| 16.5 g16.5 Graduate |
49+
| Automated Readability | -2.1 g0.0 Kindergarten| 13.2 g13.2 College |
50+
| LIX | 8.0 Children's Books | 49.7 Factual Information |
51+
| Dale-Chall | 5.3 5th-6th grade | 12.2 Graduate |
52+
| Spache | 2.3 g2.3 2nd Grade | 6.5 g5.0 Above 4th Grade |
53+
+---------------------------+-------------------------+----------------------------+
54+
```
55+
56+
All 9 formulas for `en-us` agree the second text is far harder. The bundled example prints this grid plus text metrics and a syllable histogram, for any text and language:
57+
58+
```bash
59+
python examples/demo.py
60+
```
61+
62+
**17 formulas, 86 languages, one consistent API.** Five of the formulas are truly universal — **Gunning Fog, SMOG, Coleman-Liau, ARI and LIX** score text in *every* one of the 86 languages. The remaining **12 are language-aware**, each carrying its own published coefficients: Flesch Reading Ease and Flesch-Kincaid span 12 languages, the Wiener Sachtextformel speaks German, Gulpease speaks Italian, OSMAN speaks Arabic, and the Fernández-Huerta · Szigriszt-Pazos · Gutiérrez-Polini · Crawford family handles Spanish. `get_supported_formulas()` hands each language exactly the slice that fits it — **9** formulas for `en-us`, **11** for `es`, **8** for `de-1996` — so an English-only metric never lands on a Thai sentence by mistake.
63+
1664
## Table of Contents
1765

1866
- [Installation](#installation)

0 commit comments

Comments
 (0)