Syllables pronunciation extension or service needed

Hello Everyone

I wonder if you know any Syllables pronunciation extension or service provider , for example

Hello --> Hell-O

Carpenter --> Car-Pen-ter

which makes this service as well can let's say understand it via recording it with microphone

BR

This is difficult. Not aware of any extension that can do this with App Inventor.

A possible Python solution Don https://www.researchgate.net/post/How-to-automatically-cut-words-into-syllables .

A discussion: nlp - Detecting syllables in a word - Stack Overflow

On line tool: Syllable Count Dictionary | Divide Words Into Syllables

1 Like

so it's beyond app inventor computational power , mmm i was thinking of innovative app which is based on that idea but it seems it need plenty of minds , one mind & two hands can handle it alone :smiley:

AI2 can probably do it, you would just have to write the algorithm, or create a database of words and their syllables.

1 Like

i do understand , anyway i have question off the topic regarding the database of words , let's say if i want to convert mysql db or i already have sql file for tables creation and i want to convert one column into a list or the whole db into tinydb , is there a tool created for this yet or i shall insert it manually one by one :confused:

This might give you some ideas....

it doesn't have to be about Google Sheets or SQLite, the processes are similar for most requirements....

1 Like

With javascript and AppInventor it can be done quite easily.
Just use a regez inside a script.

blocks (56)

Syllables_Divide.aia (2.1 KB)

The power of Javascript

4 Likes

Hmmm, not working here in companion?

I tested in companion on Android 11 and Android 10 works fine

Image Is screenshot of companion

Works OK (companion) on real device, Android 12, but not on my genymotion Android 10. Don't know why, javascript usually runs OK, I'll keep digging...

[EDIT] Doesn't work with customWebView either, so there must be a glitch in the emulator somewhere for regex.

[EDIT 2] Fixed it :wink: It wasn't the regex, but the .replaceAll javascript function:
image
replaced it (excuse the pun) with
image
and it works :slight_smile:
image

1 Like

@Kevinkun

Is it possible to apply the regex to your regex extension, so one could build a procedure using just blocks?

const syllableRegex = /[^aeiouy]*[aeiouy]+(?:[^aeiouy]*$|[^aeiouy](?=[^aeiouy]))?/gi;

You are right.
Android webview doesn't support not standard
ECMA script and replace all function Is a prototype function

.replaceAll works in modern browsers and in Android 10,11,12 on real devices, it just may not be backwards compatible with older devices...

In Spanish, syllabic separation is a bit more complicated, since many words have vowels with accent marks.

I have used this JavaScript code to get the Spanish syllables:
https://github.com/nicofrem/silabajs/blob/master/silabajs.js

Syllables_Divide_v2.aia (8.6 KB)

BTW, what is the hyphenation of the word ridiculous, ri-di-cu-lous or ri-dic-u-lous?

https://www.silabas.net/index-en.php?lang=%2Findex-en.php&p=ridiculous&button=Hyphenation

I would say this one (which Marco's algorithm returns)

Try rhythm or righteous:wink:

https://www.wordreference.com/definition/ridiculous

sorry I don't understand, do you want a block with this pattern? the MATCH or REPLACE function not working ?
edit: it's working:

4 Likes

I couldn't get it to work at first, but realised some editing of the regex was required:

[^aeiouy]*[aeiouy]+(?:[^aeiouy]*$|[^aeiouy](?=[^aeiouy]))?

worked for me :)

2 Likes

wo0ow thank you so much nice workaround , just doing visible false for webviewer and works perfect ,

Some more interesting results.....

ma-ry -had- a -lit-tle -lam-b it-s flee-ce -was- whi-te- as- snow
the -quic-k brow-n fox- jum-ped- o-ver- the -la-zy -dog