text-readability-score/Cargo.toml
flemming-it 2c3a6be513 feat: initial text-readability-score v0.1.0 (text.readability_score@0.1.0)
Composite readability/complexity score: Flesch-DE + Verweistiefe
+ verb-distance. Reuse-lens: any project that needs to flag
"this text is hard to read" — government letters, AGB, scientific
abstracts.

Flesch-DE follows the Amstad adaptation:

  FRE_de = 180 − ASL − (58.5 × ASW)

ASL = avg sentence length (words); ASW = avg syllables per word.
A FRE_de around 30 reads as "schwer"; below 10 is technical-jargon
territory.

Verweistiefe uses an optional graph input (output of
graph.citation_extract). i.V.m.-edges count double because they
force the reader to chase a second norm.

composite_frust scales both to 0..10 and averages, so the output
is a single number the heatmap can plot against the §6 Studie
"Frust"-Achse.

Pure in-WASM, zero filesystem, zero network.

Reserved for next versions:

  - 0.2: noun-density and Schachtelsatz penalty
  - 0.3: per-paragraph breakdown so the UI can highlight the
         most-frustrating Absatz

Signed-off-by: flemming-it <sf@flemming.it>
2026-06-18 11:25:13 +02:00

36 lines
857 B
TOML

[package]
name = "text_readability_score"
version = "0.1.0"
edition = "2024"
authors = ["Dr. Stefan Flemming <chain@flemming.ai>"]
license = "Apache-2.0"
publish = false
description = "F∆I module — composite readability/complexity score (Flesch-DE + depth + verb-distance)"
repository = "https://git.flemming.ws/chain-modules/text-readability-score"
rust-version = "1.85"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
chain-module-sdk = { git = "https://git.flemming.ai/fai/chain-module-sdk-rust.git", branch = "main" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
[profile.release]
opt-level = "s"
lto = true
codegen-units = 1
strip = "symbols"
[lints.rust]
unsafe_op_in_unsafe_fn = "warn"
[lints.clippy]
unwrap_used = "deny"
expect_used = "deny"
panic = "deny"
print_stdout = "deny"
print_stderr = "deny"
[workspace]