I am currently knocking up a word frequency counter . . .
Now my "customer" (OK, OK, my younger son) wants to be able to differentiate between "NATO" and NATO.
Using trueword it is dead easy to find all the occurrences of "NATO" with quotes by entering "NATO" in my search thing:
-
-
That gives me all the occurrences of "NATO".
However, if I enter NATO (without quotes) I get the occurrences of both "NATO" and NATO, and that is no good.
Words without quotes
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Words without quotes
Does search for text formatted as make any difference?
Code: Select all
quote & "NATO" & quote
-
- VIP Livecode Opensource Backer
- Posts: 9660
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Words without quotes
Hi,
Try this. On a new card with a button and a field, put this in the button script:
Put this in the field:
Click the button, look at the array variable "wordCount".
How much do you charge your son?
Craig
Try this. On a new card with a button and a field, put this in the button script:
Code: Select all
on mouseUp
get fld 1
repeat for each word tWord in it
add 1 to wordCount[tWord]
end repeat
breakpoint
end mouseUp
Code: Select all
nato "nato" nato "nato" nato
How much do you charge your son?
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7233
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Words without quotes
Craig's right, use "word" to include quotes. To avoid matches that occur within words, I'd check the search term for quotes and if they exist, use "word" and if not, use "trueword".
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com