Skip to content

Add readability scoring (Flesch, Flesch-Kincaid, Fog, SMOG, ARI)#318

Merged
JE-Chen merged 2 commits into
devfrom
feat/readability-batch
Jun 22, 2026
Merged

Add readability scoring (Flesch, Flesch-Kincaid, Fog, SMOG, ARI)#318
JE-Chen merged 2 commits into
devfrom
feat/readability-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

The text utilities canonicalise (text_normalize), match (text_similarity, fuzzy) and rank (search_index) text, but nothing scores how hard it is to read. This adds the classic English readability formulae over a deterministic tokeniser and syllable heuristic, so a test can assert an on-screen message or label stays within a target reading grade.

Layers

  • Headless core: je_auto_control/utils/readability/readability.pyflesch_reading_ease, flesch_kincaid_grade, gunning_fog, smog_index, automated_readability_index, readability_report, readability_stats, count_syllables. Pure stdlib (re/math), no PySide6, pure functions.
  • Facade: all re-exported + __all__.
  • Executor: AC_readability_report → full report.
  • MCP: ac_readability_report.
  • Script Builder: one CommandSpec under Data.

Tests / docs

  • test/unit_test/headless/test_readability_batch.py — 9 headless tests (syllable heuristic incl. silent-e / consonant-le, stats counts, easy-vs-hard ordering, known Flesch value, empty-text zeros + wiring + facade).
  • EN/Zh feature docs v110_features_doc.rst + toctrees; 3 README What's-new sections.

@codacy-production

codacy-production Bot commented Jun 22, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 50 complexity · 0 duplication

Metric Results
Complexity 50
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 5e543f5 into dev Jun 22, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/readability-batch branch June 22, 2026 03:41
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant