emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/writegood-mode 0bb65772a5 39/47: Add comment about Reading


From: ELPA Syncer
Subject: [nongnu] elpa/writegood-mode 0bb65772a5 39/47: Add comment about Reading Ease Score
Date: Mon, 12 Dec 2022 21:01:42 -0500 (EST)

branch: elpa/writegood-mode
commit 0bb65772a55c3b82ba30d5b5fd5ac7fbb0218e64
Author: zimoun <zimoun.toutoune@gmail.com>
Commit: zimoun <zimoun.toutoune@gmail.com>

    Add comment about Reading Ease Score
---
 writegood-mode.el | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/writegood-mode.el b/writegood-mode.el
index 7c41c38f6b..cd16a6999e 100644
--- a/writegood-mode.el
+++ b/writegood-mode.el
@@ -257,6 +257,20 @@
          (sentences (float (writegood-count-sentences start end))))
     (list sentences words syllables)))
 
+(defun writegood-reading-ease-score->comment (score)
+   "Rough meaning of the Flesch-Kincaid reading ease test.
+
+From Wikipedia URL 
`https://en.wikipedia.org/wiki/Flesch–Kincaid_readability_tests'."
+   (cond
+    ((< score 0) "Ouch! (Proust litterature)")
+    ((and (<= 0 score) (< score 30.0)) "Very difficult (college graduate)")
+    ((and (<= 30.0 score) (< score 50.0)) "Difficult (almost college)")
+    ((and (<= 50.0 score) (< score 60.0)) "Fairly difficult (10-12th grade)")
+    ((and (<= 60.0 score) (< score 70.0)) "Plain English (8-9th grade)")
+    ((and (<= 70.0 score) (< score 80.0)) "Fairly easy (7th grade)")
+    ((and (<= 80.0 score) (< score 90.0)) "Easy (6th grade)")
+    ((<= 90.0 score) "Very easy (5th grade)")))
+
 ;;;###autoload
 (defun writegood-reading-ease (&optional start end)
   "Flesch-Kincaid reading ease test. Scores roughly between 0 and 100."
@@ -266,7 +280,8 @@
           (words     (nth 1 params))
           (syllables (nth 2 params))
           (score  (- 206.835 (* 1.015 (/ words sentences)) (* 84.6 (/ 
syllables words)))))
-     (message "Flesch-Kincaid reading ease score: %.2f" score)))
+     (message "Flesch-Kincaid reading ease score: %.2f. %s" score
+            (writegood-reading-ease-score->comment score))))
 
 ;;;###autoload
 (defun writegood-grade-level (&optional start end)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]