Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Regex Syllables, Harlan Grove?

Good Morning, I am not very sofisticated when it comes to these
things,is there a way to count syllables using regex. If I had the
word "understand" in A1 I would like it to return 3. I need to do this
for a reader reliablility formula that I am working on. Any help would
be greatly appreciated. Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default Regex Syllables, Harlan Grove?

I can't help you with regex, but you could use the following user-defined
function to count the vowels in a cell:

Public Function CountVowels(TxtIn As String) As Long
Dim x As Long
CountVowels = 0
For x = 1 To Len(TxtIn)
Select Case UCase(Mid(TxtIn, x, 1))
Case "A", "E", "I", "O", "U"
CountVowels = CountVowels + 1
Case Else
'do nothing
End Select
Next x
End Function

This code should be palced in a general VBA module in your workbook.

You would call it like this (enter as a formula in a cell):

=CountVowels(A1)

If you are new to user-defined functions (macros), this link to Jon
Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"PJ" wrote:

Good Morning, I am not very sofisticated when it comes to these
things,is there a way to count syllables using regex. If I had the
word "understand" in A1 I would like it to return 3. I need to do this
for a reader reliablility formula that I am working on. Any help would
be greatly appreciated. Thanks in advance!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Regex Syllables, Harlan Grove?

Not sure that helps with a word like "house".

Tom Hutchins wrote:
I can't help you with regex, but you could use the following user-defined
function to count the vowels in a cell:

Public Function CountVowels(TxtIn As String) As Long
Dim x As Long
CountVowels = 0
For x = 1 To Len(TxtIn)
Select Case UCase(Mid(TxtIn, x, 1))
Case "A", "E", "I", "O", "U"
CountVowels = CountVowels + 1
Case Else
'do nothing
End Select
Next x
End Function

This code should be palced in a general VBA module in your workbook.

You would call it like this (enter as a formula in a cell):

=CountVowels(A1)

If you are new to user-defined functions (macros), this link to Jon
Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"PJ" wrote:

Good Morning, I am not very sofisticated when it comes to these
things,is there a way to count syllables using regex. If I had the
word "understand" in A1 I would like it to return 3. I need to do this
for a reader reliablility formula that I am working on. Any help would
be greatly appreciated. Thanks in advance!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Regex Syllables, Harlan Grove?

PJ wrote...
Good Morning, I am not very sofisticated when it comes to these
things,is there a way to count syllables using regex. If I had the
word "understand" in A1 I would like it to return 3. I need to do this
for a reader reliablility formula that I am working on. Any help would
be greatly appreciated. Thanks in advance!


Can't do this with regular expressions.

Since most languages using single phoneme alphabets (e.g., Latin,
Cyrillic, Greek, Arabic) have no consistent rules with regard to
dividing words into syllables, there's no alternative to looking up
words in a dictionary list to determine the number of syllables. The
dictionary list would need to look something like

the the
foobar foo bar
banana ba na na

that is, the word in the first field, the syllables in the subsequent
fields, so the number of syllables equals the number of fields in the
matching record less one.
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Regex Syllables, Harlan Grove?

On Apr 30, 12:58*pm, Harlan Grove wrote:
PJ wrote...
Good Morning, I am not very sofisticated when it comes to these
things,is there a way to count syllables using regex. If I had the
word "understand" in A1 I would like it to return 3. I need to do this
for a reader reliablility formula that I am working on. Any help would
be greatly appreciated. Thanks in advance!


Can't do this with regular expressions.

Since most languages using single phoneme alphabets (e.g., Latin,
Cyrillic, Greek, Arabic) have no consistent rules with regard to
dividing words into syllables, there's no alternative to looking up
words in a dictionary list to determine the number of syllables. The
dictionary list would need to look something like

the * * the
foobar *foo * * bar
banana *ba * * *na * * *na

that is, the word in the first field, the syllables in the subsequent
fields, so the number of syllables equals the number of fields in the
matching record less one.


Thanks.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hi, Harlan Grove, ? about negative time formula Dale G[_2_] Excel Worksheet Functions 13 December 17th 08 01:08 AM
Continuation to equivalent for formula - to Mr. Harlan Grove (and notonly...) ytayta555 Excel Worksheet Functions 1 July 9th 08 01:32 PM
Harlan Grove PULL Code Help Please deeds Excel Worksheet Functions 19 April 27th 07 09:28 PM
PULL function (Harlan Grove) - can it use Named Ranges? [email protected] Excel Worksheet Functions 3 July 28th 06 07:08 PM
# of Functions per cell >> for Harlan Grove SUB-ZERO Excel Worksheet Functions 0 January 24th 05 02:39 PM


All times are GMT +1. The time now is 09:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"