Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 The Yak Corral
 Word Challenge

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2005-10-31 : 11:46:22
This is more of a musing than a real problem, but it can be entertaining to pursue a problem for whimsy now and again.

It would be a useful tool (for me) if I had a JavaScript that would take the "selected source" on a page and calculate the Flesch-Kincaid reading index - (or possibly any of several reading indexes). The algorithms are pretty simple, but one little parameter is required that isn't so simple to calculate... the number of syllables in each word.

If you want background or would like to see the formulas, here are a couple of links that discuss the various reading indexes and their formulas:

http://juicystudio.com/services/readability.php
http://en.wikipedia.org/wiki/Flesch-Kincaid_Readability_Test

Is there a way to get syllables per word without a dictionary? If a dictionary database is required, then that's another kettle of fish. (If you have knowledge of an suitable dictionary DB, any info would be appreciated). (I guess I could learn to access a DB from JavaScript).

Sam

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-10-31 : 12:15:26
i thought that number of syllables is equal to number of vowels. if there are none then it's one syllable.
isn't that so?

Go with the flow & have fun! Else fight the flow
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-10-31 : 12:17:29
spirit -- "Boat" has 2 vowels, but one syllable. And so on ...
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-10-31 : 12:20:06
silly english... complicates things that much...

so then... how do you guys define a syllable??

Go with the flow & have fun! Else fight the flow
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-10-31 : 12:34:14
A "syllable" is a pronounciation thing; the number of "beats" it takes to say a word. In musical terms, the # of syllables a word has is often the number of notes in the melody it matches.

i.e., "Hap-py Birth-day" -- each word has 2 syllables. "To You" -- each word has 1 syllable.

Many (all?) languages, not just English, do NOT have a 1:1 correlation between vowels and syllables.

http://en.wikipedia.org/wiki/Syllable
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-10-31 : 12:38:21
yeah... we don't
here's it's basicaly the rule i said previously...

Go with the flow & have fun! Else fight the flow
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-10-31 : 12:40:17
>>so then... how do you guys define a syllable??
I agree that it's a pronounciation thing.
coin: one sylable
coincide: three sylables (co~in~cide)

I'm sure there are (complex) rules to count sylables but I'll bet there are plenty of exceptions.

EDIT:
I guess if you misspell words (like syllable) it's even harder :)

Be One with the Optimizer
TG
Go to Top of Page

mcrowley
Aged Yak Warrior

771 Posts

Posted - 2005-10-31 : 12:58:40
Hmm. A vowel followed by a consonant should indicate a syllable, as well as a trailing -y or a trailing -le. Then there is the word Diary. DANG!
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2005-10-31 : 13:00:16
You certainly need to turn it into phonemes first, and for that you'll need a dictionary.

'he had had in his possession a bunchberry plant', as they say in Nuxálk.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-10-31 : 13:59:01
sam what are you working on??
lately you had some cool feature requests... i'm intrigued...

Go with the flow & have fun! Else fight the flow
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-10-31 : 14:06:57
Don't forget acronyms. Is it S-Q-L or se-quel?




CODO ERGO SUM
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2005-10-31 : 14:30:17
quote:
Originally posted by spirit1

sam what are you working on??

When I get involved reviewing course content, we copy the content into MS-Word which can calculate the Flesch-Kincaid grade level (It's a configuration option in the Word spelling-grammer checker under Tools/Options). We like to dumb text down towards 9th grade if possible, even for techical subjects. Often I don't take the time to do this because of the number of steps.

There may be improvements to the "vowel method" (e.g., any word with 2 vowels under 5 characters is a single syllable), which would make it accurate "enough" for use. I may give it a go when I have the time.

Sam
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-10-31 : 14:37:41
Why not use javascript to load it into a Word document and use the method available there to make the calculation?




CODO ERGO SUM
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2005-10-31 : 14:46:21
quote:
Originally posted by Michael Valentine Jones

Why not use javascript to load it into a Word document and use the method available there to make the calculation?

I haven't any experience interacting with MS Office through JavaScript. Have you?

Sam
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-10-31 : 15:08:03
Sorry, no experience using MS Office with javascript, but I have seen it done.

I just come up with ideas, I don't actually implement them.





CODO ERGO SUM
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-10-31 : 15:32:32
When you say "javascript", it sound like you are implying that a web page will do this. I would have the web server (not client) process this request, and then you can use VBScript (for ASP) or any of the .NET languages (ASP.NET) on the server to instantiate a Word Application object and go from there.

You would create a Word.Application object, create a new document, insert in the text that is submitted to check, and call whatever method of Word you need to get the value you are looking for. Recording a macro in Word and checking the code generated may be helpful for finding this out. I didn't see this option specifically in Word 2000, but I only looked briefly.

Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-10-31 : 15:48:43
but that means you need to have word installed on your web server which i don't think is that great...
maybe you can use OWC. don't know if they have that functionality.


Go with the flow & have fun! Else fight the flow
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-11-01 : 00:36:04
don't know if it's related or you can use it, but visual basic has a cool tool, "genie", it's a text reader and i think you can use it to highlight syllables. I've only used in as an "alarm" so far.

i found this but haven't opened the file
http://math.hws.edu/eck/cs124/javanotes3/source/TextReader.java



--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -