dbTalk Databases Forums  

Help on word counting

comp.databases.filemaker comp.databases.filemaker


Discuss Help on word counting in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Newzad Hirorî
 
Posts: n/a

Default Help on word counting - 11-15-2006 , 08:01 PM






Dear all,

Would somebody help me to let FM 5.5 (on WinXP) count for me the number and
frequency of words (and eventually letters also) in a text file?

Thank in advance

- Newzad Hirori



Reply With Quote
  #2  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Help on word counting - 11-15-2006 , 09:19 PM






In article <aEP6h.23047$E02.9643 (AT) newsb (DOT) telia.net>, "Newzad Hirorî"
<nhirori (AT) hotmail (DOT) com> wrote:

Quote:
Dear all,

Would somebody help me to let FM 5.5 (on WinXP) count for me the number and
frequency of words (and eventually letters also) in a text file?

Thank in advance
In a Text "file" or Text field???

For a Text file, it would probably be easier to use the Word Count
feature in Microsoft Word. There's no doubt already a piece of
shareware / freeware around that will do both the counting and
frequency calculations for you.


For a Text field in a FileMaker database, then counting the words and
letters is fairly easy.

Count_of_Words = WordCount(TextField)

Count_of_Letters = Length(TextField)

BUT this letter count won't be just letters, but will also include
spaces, commas, fullstops / periods, quote marks, appostrophes,
question marks, exclamation marks, etc. You can remove these from the
count by using the PatternCount function.
eg.

Count_of_Letters
= Length(TextField) - PatternCount(TextField, " ")
- PatternCount(TextField, ",")
- PatternCount(TextField, ".")
- PatternCount(TextField, "'")
- PatternCount(TextField, "?")
- PatternCount(TextField, "!")

You may also need to run a couple of tests to see what WordCount does
with hyphenated words - I'm not sure if those are counted as one word
or two. You can get around it counting as two by temporarily replacing
them with "nothing".
ie.
Count_of_Words = WordCount(Substitute(TetxField, "-", ""))



The frequency of words will be more difficult. You'd have to split the
text into separate words and then count or summarise (using Summary
functions) the number of each ... it is possible, but would require a
script and preferrably a separate table. It could get quite time
consuming too if you're trying to summarise lots of records and / or
large amounts of text.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.