Just One Array Intersect Question

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Post by deeverd » Thu Jan 24, 2008 6:08 pm

Here's a bit of a progress report:

I've finally had a chance to intensely play with the script "filter without" which is something I've never before used. In fact, I only read of the filter command about a week ago, and saw it in conjuction with forcing a user to save a text file with the proper extension. (It was part of Dan Shafer's "To Do List" program example).

Anyway, I am finding "filter without" to be extremely powerful and useful in this project.

Thanks much. Cheers, deeverd

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Feb 16, 2008 3:59 pm

Hi Deeverd,

I found a link to this discussion today and after reading the whole lot, I'm thinking, why do you want to check the occurrence of particular words only and, if indeed particular words, why is all this turning out to be so complex?

Why can't you simply do something like this:

Code: Select all

put the number of words of myBook into myNr
repeat for each word myWord in myList
  if myWord is in myBook then
    put myBook into myTempBook
    replace myWord with empty in myTempBook
    put myNr - number of words of myTempBook into myArray[myWord]
  else
    put 0 into myArray[myWord]
  end if
end repeat
combine myArray by cr and tab
put myArray into fld "Your Table Field"
Untested, it might not work, but you get the idea.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Post by deeverd » Tue Feb 19, 2008 4:17 pm

Hi Mark,

Thanks for remembering my plight. Your script looks fascinating and I will definitely experiment with it. I never did get the array to work completely in the manner I had originally planned, but with your insight and advice on using the "filter with" and "filter without" commands, I can now receive very accurate returns very quickly.

You were wondering why I would want to find the numbers of the occurence of particular words. By June of this year at the university, I will finally be completing all the coursework for my PhD program, which combines my major of literacy with my minor of technology in education. What I am creating is software for my dissertation to analyze high school writing proficiency examinations in order to determine what the successfully passing examinations have in common, what the barely passing examinations have in common, and what the unsuccessful examinations have in common, plus how each of those categories differ from one another.

One of the ways of doing this is to create arrays that give me a list of unique words, and arrays that give me frequencies of words. There's a lot of other things involved too, but I will be gaining a lot of my data in that way so that in the future, my research will hopefully be used by teachers to help more students to pass these tests, since they cannot receive a high school diploma if they don't pass.

Thanks again. Looking very forward to trying this script. All the best, deeverd

bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

PhD

Post by bjb007 » Tue Feb 19, 2008 4:23 pm

deeverd

Well, if it was up to me you could have
your PhD tomorrow. You've certainly gone
for something useful - which can't be said
of a lot of academic work.
Life is just a bowl of cherries.

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Post by deeverd » Wed Feb 20, 2008 5:07 pm

Hello bjb007,

Thanks for your vote of confidence. I, too, am often amazed that my colleagues specialize in areas that seem to be of so little use to so few people. But who's to say? Bringing new knoweldge into the world that does not seem very relevant today might have an important impact for tomorrow. Nevertheless, I like to pursue what I can use right now. Have a great week, deeverd

Post Reply