List Info

Thread: Counting Syllables in a Word




Counting Syllables in a Word
user name
2006-10-25 14:48:53
Hello All,

Can anyone suggest a good regex for counting syllables in a
word? The
language is English and I will be using VBScript.RegExp.
Thanks in
advance.

Rick Quatro


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps-beta.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Counting Syllables in a Word
user name
2006-10-25 16:41:16
frameexpert wrote:
> Hello All,
>
> Can anyone suggest a good regex for counting syllables
in a word? The
> language is English and I will be using
VBScript.RegExp. Thanks in
> advance.

Hi, Rick:

I guess it's not easy to implement the rules of counting
syllables with
a single regex pattern. You can look at the source code of
the Perl
Module "Lingua::EN::Syllable" which does the same
thing but uses things
more than regex.. But I guess you might make a similar
VBScript
function by just following this Perl Module source code.

Regards,
Xicheng 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps-beta.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Counting Syllables in a Word
user name
2006-10-25 16:41:16
frameexpert wrote:
> Hello All,
>
> Can anyone suggest a good regex for counting syllables
in a word? The
> language is English and I will be using
VBScript.RegExp. Thanks in
> advance.

Hi, Rick:

I guess it's not easy to implement the rules of counting
syllables with
a single regex pattern. You can look at the source code of
the Perl
Module "Lingua::EN::Syllable" which does the same
thing but uses things
more than regex.. But I guess you might make a similar
VBScript
function by just following this Perl Module source code.

Regards,
Xicheng 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps-beta.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Counting Syllables in a Word
user name
2006-10-26 12:15:03
Thanks for the reply. Here is what I came up with. It is not 100% accurate, but I think it is within acceptable limits.

// Count vowels not followed by another vowel, or
// at the end of the word.
Set oRegex.Pattern = '[aeiouy](?=[^aeiouy]|$)';
Set iSyllables = oRegex.Execute{sWord}.Count;
If iSyllables > 1
  // See if the word ends with an "e".
  Set oRegex.Pattern = 'eW*$';
  If (oRegex.Test)
    // See if it ends with "le".
 ;   Set oRegex.Pattern = 'leW*$';
    If (oRegex.Test = 0)
     ; // Subtract one of the vowels.
      Set iSyllables = iSyllables - 1;
    EndIf
  EndIf
EndIf

Rick

On 10/25/06, Xicheng Jia < xichenggmail.com">xichenggmail.com> wrote:

frameexpert wrote:
>; Hello All,
>
> Can anyone suggest a good regex for counting syllables in a word? The
> language is English and I will be using VBScript.RegExp. Thanks in
> advance.

Hi, Rick:

I guess it's not easy to implement the rules of counting syllables with
a single regex pattern. You can look at the source code of the Perl
Module "Lingua::EN::Syllable" which does the same thing but uses things
more than regex.. But I guess you might make a similar VBScript
function by just following this Perl Module source code.

Regards,
Xicheng



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )