String to Syllable Conversion Function

Post your working scripts, libraries and tools
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
GitHub: TLMcode
Contact:

String to Syllable Conversion Function

25 Jul 2015, 12:48

Converts a string of words to syllables ( must have internet access )

Code: Select all

; Example
str = artifacts of any general preference
msgbox % GetSyllable( str )

; -----------------
GetSyllable( str )
{
    url = http://www.juiciobrennan.com/syllables/
    htReq:=ComObjCreate("WinHttp.WinHttpRequest.5.1"), doc:=ComObjCreate("HTMLfile")
    htReq.Open("POST", url, False), htReq.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    htReq.Send("inputText=" str), doc.Write( htReq.ResponseText)

    return doc.getElementByID("inputText").innerHTML
}
NOTE: the source page uses api calls from a 3rd party dictionary site and may be subject to change or become unavailable at some point.
User avatar
BGM
Posts: 507
Joined: 20 Nov 2013, 20:56
GitHub: bgmCoder
Contact:

Re: String to Syllable Conversion Function

25 Jul 2015, 19:38

tlm - that's great! It works, too!
Thanks for this.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: BranCorell, hotcheesesoup, TheArkive, TomDonovan and 25 guests