Count repetitive words

G

Guest

How do I count the number of repetitive words?
Is there a way I can pick a particular word to look for?
 
G

Guest

Greg,

Great tool! How can I make it diferentitate between CAPITAL versions of a
word and non? For instance it versus IT.
 
G

Greg Maxey

Well that gets pretty gnarly ;-)

You could revise the code as follows:

Change:
SingleWord = Trim(LCase(aWord))
To:
SingleWord = Trim(aWord)
Change:
If SingleWord < "a" Or SingleWord > "z" Then
SingleWord = "" 'Out of range?
NonWordObjects = NonWordObjects + 1 '
End If
To:
If SingleWord < "A" Or SingleWord > "z" Or Asc(SingleWord) > 90 And
Asc(SingleWord) < 97 Then '= "[" Or SingleWord = "]" Then
SingleWord = "" 'Out of range?
NonWordObjects = NonWordObjects + 1 '
End If

But that would count "it" "IT" and "It" as three separatar words. I
haven't taken the time to figure out how to process the first word of a
sentence or how they should be counted. They are all in fact the same word
;-)
 
G

Guest

Greg,

LOL! That sounds like me doing a macro and well I am not good at that.
IT as in Information Technology and it are different words. Especially in a
CV!
Thanks for your help though.

Greg Maxey said:
Well that gets pretty gnarly ;-)

You could revise the code as follows:

Change:
SingleWord = Trim(LCase(aWord))
To:
SingleWord = Trim(aWord)
Change:
If SingleWord < "a" Or SingleWord > "z" Then
SingleWord = "" 'Out of range?
NonWordObjects = NonWordObjects + 1 '
End If
To:
If SingleWord < "A" Or SingleWord > "z" Or Asc(SingleWord) > 90 And
Asc(SingleWord) < 97 Then '= "[" Or SingleWord = "]" Then
SingleWord = "" 'Out of range?
NonWordObjects = NonWordObjects + 1 '
End If

But that would count "it" "IT" and "It" as three separatar words. I
haven't taken the time to figure out how to process the first word of a
sentence or how they should be counted. They are all in fact the same word
;-)


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

itgreenwich said:
Greg,

Great tool! How can I make it diferentitate between CAPITAL versions of a
word and non? For instance it versus IT.
 
S

Suzanne S. Barnhill

You can use Find for this. In the Find dialog, check the box for "Match
Case." Then select "Highlight all items found" and click Find All. Word will
tell you how many it found (and they will be selected).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

itgreenwich said:
Greg,

LOL! That sounds like me doing a macro and well I am not good at that.
IT as in Information Technology and it are different words. Especially in a
CV!
Thanks for your help though.

Greg Maxey said:
Well that gets pretty gnarly ;-)

You could revise the code as follows:

Change:
SingleWord = Trim(LCase(aWord))
To:
SingleWord = Trim(aWord)
Change:
If SingleWord < "a" Or SingleWord > "z" Then
SingleWord = "" 'Out of range?
NonWordObjects = NonWordObjects + 1 '
End If
To:
If SingleWord < "A" Or SingleWord > "z" Or Asc(SingleWord) > 90 And
Asc(SingleWord) < 97 Then '= "[" Or SingleWord = "]" Then
SingleWord = "" 'Out of range?
NonWordObjects = NonWordObjects + 1 '
End If

But that would count "it" "IT" and "It" as three separatar words. I
haven't taken the time to figure out how to process the first word of a
sentence or how they should be counted. They are all in fact the same word
;-)


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

itgreenwich said:
Greg,

Great tool! How can I make it diferentitate between CAPITAL versions of a
word and non? For instance it versus IT.

:

Well you can use find and replace to find the word and replace it with
the
same word. You can also use an Add-In that I created to do this sort of
thing:

http://gregmaxey.mvps.org/Word_Frequency.htm

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

How do I count the number of repetitive words?
Is there a way I can pick a particular word to look for?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top