Hi,
This may not be a good starting project for a beginner, so I thought it would be wise to check.
I can write up a small text file (.txt) that is tab delimited, with a numbered list of word categories (for example, 1=noun, 2=verb, 3=adjective, etc.) and another longer list of common nouns, verbs, adjectives, etc. that the dictionary is screening a block (string) of text for.
New to RunRev, I looked at the RunRev distionary and found matchText and suspect it may be involved in this task?
The block of text would be cut/pasted or dragged by the user into a text entry field, which I think would need to be scripted to write these words as a string into a variable (array?).
Then, once the user, for example clicks a button called "analyze" coded to open the dictionary, read its tab delimited content, analyze the words in the string array for matches in the dictionary and finally report the number of words matched for each word category.
So, for example, a block of text, "Two young boys played soccer." would be analyzed and show the result (hopefully though my grammar is a bit rusty):
noun=2
verb=1
adjective=2
I would appreciate any suggestions regarding level of difficulty for a RunRev beginner, and if this project can be done by a beginner, any help getting started: leads, sample stacks/tutorials to check out, suggestions how to set up a small test version on which to build.
I think this can be a good way to learn, if not too difficult.
Thanks for your help.
Kind Regards,
Searching Text Using Tab Delimited TXT file dictionary
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 87
- Joined: Thu Jul 17, 2008 8:42 pm
Searching Text Using Tab Delimited TXT file dictionary
saratogacoach
LiveCode 4.6.0, Windows 7 Home Premium 64 bit, Core i7 2.80, 8G RAM, ATI Radeon HD5770
LiveCode 4.6.0, Windows 7 Home Premium 64 bit, Core i7 2.80, 8G RAM, ATI Radeon HD5770
sounds like a good starting stack, as long as your list of terms is extremely complete. especialy as many words have several ways to be spelled or change depending on context.
However, i suggest using the various chunk stuff to do what you want. try to understand the following entries in the dictionary (also, look up chunks in the documentation pdf):
itemdelimiter
linedelimiter
word
item
line
repeat for each item/line/word
offset
lineoffset
wordoffset
itemoffset
However, i suggest using the various chunk stuff to do what you want. try to understand the following entries in the dictionary (also, look up chunks in the documentation pdf):
itemdelimiter
linedelimiter
word
item
line
repeat for each item/line/word
offset
lineoffset
wordoffset
itemoffset
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
-
- Posts: 87
- Joined: Thu Jul 17, 2008 8:42 pm
Thanks, Bvg.
After doing some of the reading, as you suggest, I would like to create a small test stack. I can create a small text file with 3 categories and 20 common words as a starting point.
Then a small stack with one text entry field (to drag text into) and a single button coded to open and read the text file and check if any words dropped into the entry field will match words in the text file, then finally a message box with results showing any matches.
Doesn't sound too difficult, but I suspect easier said than done.
Tried a little experiment on chunks: created a stack with an entry field ("Field1") and a button. Previewed and typed into the field "My name is saratogacoach." Button code:
OK, that works.
Kind Regards,
After doing some of the reading, as you suggest, I would like to create a small test stack. I can create a small text file with 3 categories and 20 common words as a starting point.
Then a small stack with one text entry field (to drag text into) and a single button coded to open and read the text file and check if any words dropped into the entry field will match words in the text file, then finally a message box with results showing any matches.
Doesn't sound too difficult, but I suspect easier said than done.
Tried a little experiment on chunks: created a stack with an entry field ("Field1") and a button. Previewed and typed into the field "My name is saratogacoach." Button code:
Code: Select all
on mouseUp
put word 4 of field "Field1" into temptext
answer temptext
end mouseUp

Kind Regards,
saratogacoach
LiveCode 4.6.0, Windows 7 Home Premium 64 bit, Core i7 2.80, 8G RAM, ATI Radeon HD5770
LiveCode 4.6.0, Windows 7 Home Premium 64 bit, Core i7 2.80, 8G RAM, ATI Radeon HD5770