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

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

[nongnu] elpa/writegood-mode a00ba459e7 26/47: Modified the syllable est


From: ELPA Syncer
Subject: [nongnu] elpa/writegood-mode a00ba459e7 26/47: Modified the syllable estimation function
Date: Mon, 12 Dec 2022 21:01:41 -0500 (EST)

branch: elpa/writegood-mode
commit a00ba459e799d06243594b1b3f6ac0448dd150ae
Author: Benjamin Beckwith <bnbeckwith@gmail.com>
Commit: Benjamin Beckwith <bnbeckwith@gmail.com>

    Modified the syllable estimation function
    
    Consecutive syllables are not counted as one. The endings -es -ed and -e
    are subtracted from the overall count.
---
 writegood-mode.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/writegood-mode.el b/writegood-mode.el
index 54b573830f..f45fe717a1 100755
--- a/writegood-mode.el
+++ b/writegood-mode.el
@@ -234,8 +234,13 @@
   (how-many (regexp-opt-charset writegood-sentence-punctuation) rstart rend))
 
 (defun writegood-count-syllables (rstart rend)
-  "Count the number of syllables in the region bounded by RSTART and REND."
-  (how-many (regexp-opt-charset writegood-vowels) rstart rend))
+  "Count the (approximate) number of syllables in the region bounded by RSTART 
and REND.
+
+   Consecutive vowels count as one syllable. The endings -es -ed
+   and -e are not counted as syllables.
+  "
+  (- (how-many "[aeiouy]+" rstart rend)
+     (how-many "\\(es\\|ed\\|e\\)\\b" rstart rend)))
 
 (defun writegood-fk-parameters (&optional rstart rend)
   "Flesch-Kincaid reading parameters"



reply via email to

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