Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Splitting text into syllables

by Bod (Parson)
on Jan 25, 2022 at 22:43 UTC ( [id://11140867]=note: print w/replies, xml ) Need Help??


in reply to Splitting text into syllables

I am looking for a good solution to split up German text into its syllables

Within my company, we produce a lot of marketing content and aim to constantly improve the quality of this copy. So I insist on a Flesch Kincaid Grade Score of no more than 7.5. But, the problem is getting a reliable and consistent Grade Score. We use The Hemingway App. But I wanted a solution attached to our content creating platforms which are written in Perl. So I started using Lingua::EN::Fathom which uses Lingua::EN::Syllable.

The first thing I noticed was that Lingua::EN::Fathom and The Hemingway App disagree on the Grade Score.

But, it is helpful to have a browser-side real-time calculation of the Grade Score. Not to have to keep sending AJAX requests back to a Perl script on the server. So I searched and found a Javascript solution. It works...but is even further out on its calculation of the Grade Score.

After some investigation, I traced the discrepancies to the way that these three methods calculate the syllable count...they all do it very differently!

So I will probably end up writing my own Grade Score calculator that uses the same method of calculation in both Perl and Javascript. It doesn't matter too much how accurately it reflects other tools. What is more important is that the two agree on any given piece of text. Then we can adjust the company rule on Grade Score to reflect what the tools are saying. But this has moved down the priority list as we have bought a subscription to Grammarly which is doing a good job of improving the quality and consistency of our written content.

Replies are listed 'Best First'.
Re^2: Splitting text into syllables
by bliako (Monsignor) on Jan 26, 2022 at 02:02 UTC

    OT: using javascript makes the user's computer calculate the score, whereas using Perl (at the backend) makes the backend calculate it, and website owner pays for it. I am glad to see someone placing quality above cost.

    edit: of course js can be used at the backend just like anything else, i just assumed it is browser-running js.

      i just assumed it is browser-running js

      Yes, I did mean browser Javascript

      The main rationale for trying to use a JS solution is time. When typing, there is a (sometimes significant) time lag between what is typed and the displayed Grade Score due to the AJAX calls. With JS running in the browser, the delay is negligible. A decreased load on the server and network are secondary, but very real, benefits.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11140867]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (None)
    As of 2024-04-25 04:23 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found