How to find words and phrases as well
André.Bisseret
Andre.Bisseret at inria.fr
Sun Jan 29 05:55:23 EST 2006
Hello,
I was just about posting an answer to Éric, when I read the messages
from Jeanne, Wilhelm, and Jim. Thanks a lot to all of you for your
attention ; that makes me much more serene for this week-end !
First of all, I will send the answer I wrote for Éric after having
completed it, thanks to the others’ questions or suggestions. (
After that I will study more utterly the messages from Jeanne, Jim and
Wilhelm.
Wilhelm, after a quick reading of the script I understand that you used
3 nested “repeats” . In each field of each card you have a repeat
lineOffset ; I am glimpsing there a way for me ; but, hum ! I should do
that for several keywords …, likely a fourth nested repeat ? Well, I
have to look at more deeply !
Now, I am trying to better explain my problem, taking into account your
questions (sorry, it seems too long !)
My app. contains, in a main stack, about three hundred cards.
Each card has a code (written in a small specific field).
Each card presents texts (mainly by means of three fields) :
- one display the reference of a cognitive sciences paper (mainly from
psychological research in the domain of man-machine interfaces and
multimedia documents, often learning documents)
- the second presents the title of the third
- the third includes the text itself (equivalent to one or two A4
pages). It is an analytical summary of the relevant points of the
referred paper ( tasks, methods, results…) completed by practical
recommendations inferred from the results of the paper).
So, t is a textual database (for the practitioners in the domain).
In a substack (a smaller window which appears on request) I have
developed a (very) simple “search engine”
In one field the users write one or several keywords, separated by
spaces.
Near this field is a button “Search”, a click on which launches a
script. The core of this script is a find :
“find words keywordsList”.
As you now, this instruction is enough to get immediately (without any
repeat etc.) the subset of the cards that include all the keywords (AND
is implied, not OR).
Then, the list of these found cards (the results) is returned into two
columns: one contains the codes of the cards (one per row), and the
second, the titles of the texts.
Each code is clickable, leading the users to the corresponding card ;
there, they found their keywords highlighted, everywhere and anywhere
they are in any of the three fields).
For example, if the user writes, in the keywords field : [learning
multimedia children], s(he) obtains the cards which include, at least
once (but often several times), each of this 3 words, and this,
anywhere in the three textual fields.
Thus, the user can navigate among the selected cards supposed to
pertain to one same specific theme (those induced by the keywords).
This works well,
BUT I would like to improve the selectivity of the filter:
In order to get more precise and better selected results, I would like
to be able to search not only single words, but possibly phrases (may
be this word is ambiguous as it is for French people ; simply I mean
“expressions” or “compound-words”), such as “multimedia learning” or
“speech recognition” or “touch screen display” etc. but as wholes, not
as two or three different single words. Actually, a text including
“speech” somewhere and “recognition” elsewhere could well not pertain
at all to the subject “speech recognition”. (but, currently, it would
be returned by my script).
So, I much would like that the request of a user could include such
expressions and/or single words as well.
For example, [children image “multimedia learning”]; (I quote here only
to mean that the third keyword is not two words but one expression).
I think that the problem is right here. If I had to search for only one
word or one “expression”, I could easily do it by means of “find whole”
or find “string” as you are suggesting.
But I have to search for the list of keywords and/or keyExpressions. I
want to select the cards that include simultaneously each word and
expressions requested by the user, regardless of their order and their
location in the 3 fields.
I feel that nested “repeat” like in the script of Wilhelm might be the
way ; I glimpse it for one word or expression but not yet for several.
Really sorry for my long message, but I tried to be clearer (not sure
!??!). And could be, I am missing something simple ?
all the best and thanks to the four of you,
from Grenoble
André
Le Saturday, 28 Jan 2006, à 16:49 Europe/Paris, Eric Chatonet a écrit :
> Hi Andre,
>
> Would "find whole" instead of "find words" help?
>
> On the other hand I have realized complex search scripts that parse a
> text to retrieve, for instance, all phrases (paragraphs) that contain
> pStr1 AND pStr2, etc.
> Could you be more precise about your needs?
> Then I might be able to help.
>
> Best Regards from Paris,
> Eric Chatonet
>
More information about the use-livecode
mailing list