dbTalk Databases Forums  

stop word lookup: calculation field: subphrase exists in lookup table

comp.databases.filemaker comp.databases.filemaker


Discuss stop word lookup: calculation field: subphrase exists in lookup table in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
grasshopper
 
Posts: n/a

Default stop word lookup: calculation field: subphrase exists in lookup table - 06-20-2005 , 03:57 PM






This one seems to be really tricky, or my mind might be on vacation,
but I believe it's the former. Essentially, I'm attempting to implement
a stop word lookup table.

I have a table (called Keyphrases) with a field called phrase.

I also have a table (called StopWords) with a field called word.

I'm trying to create a calculation field in Keyphrases
(e.g.Keyphrases:c_color) that is set to black (for example) if any of
the *words* in Keyphraseshrase exists in StopWords:word.

e.g. if my StopWords table contained the values in the word field:

apple
orange
pear

and my Keyphrases table contained in the phrase field:

apple tree
hazelnut tree
peach tree
pear tree
red apples
pear pie

then the corresponsing Keyphrases:c_color fields would be:

apple tree black
hazelnut tree
peach tree
pear tree black
red apples
pear pie black

(red apples wouldn't match, since I need to match on full words, not
partials... apple <> apples)

Would anyone know the spell for this? I really, really need to know
asap, is it ever any other way? You guys always seem to know a trick
around the seemingly impossible.

thanks folks.
B

Reply With Quote
  #2  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: stop word lookup: calculation field: subphrase exists in lookup table - 06-20-2005 , 06:01 PM






I saw a "Text HiLight" example in my files (I am not the author).
It may be useful to you. Hopefully.
You may give me your address for me to send it to you.
Remi-Noel

----- Original Message -----
From: "grasshopper" <nospam (AT) thevoid (DOT) com>
Newsgroups: comp.databases.filemaker
Sent: Monday, June 20, 2005 10:57 PM
Subject: stop word lookup: calculation field: subphrase exists in lookup
table


Quote:
This one seems to be really tricky, or my mind might be on vacation,
but I believe it's the former. Essentially, I'm attempting to
implement
a stop word lookup table.

I have a table (called Keyphrases) with a field called phrase.

I also have a table (called StopWords) with a field called word.

I'm trying to create a calculation field in Keyphrases
(e.g.Keyphrases:c_color) that is set to black (for example) if any of
the *words* in Keyphraseshrase exists in StopWords:word.

e.g. if my StopWords table contained the values in the word field:

apple
orange
pear

and my Keyphrases table contained in the phrase field:

apple tree
hazelnut tree
peach tree
pear tree
red apples
pear pie

then the corresponsing Keyphrases:c_color fields would be:

apple tree black
hazelnut tree
peach tree
pear tree black
red apples
pear pie black

(red apples wouldn't match, since I need to match on full words, not
partials... apple <> apples)

Would anyone know the spell for this? I really, really need to know
asap, is it ever any other way? You guys always seem to know a trick
around the seemingly impossible.

thanks folks.
B



Reply With Quote
  #3  
Old   
Matt Wills
 
Posts: n/a

Default Re: stop word lookup: calculation field: subphrase exists in lookup table - 06-20-2005 , 07:59 PM



NightWing has a demo for highlighting specific words in text which may be
helpful:

http://www.nightwing.com.au/FileMake...7/demo701.html

Matt

On 6/20/2005, grasshopper wrote:

Quote:
This one seems to be really tricky, or my mind might be on vacation,
but I believe it's the former. Essentially, I'm attempting to implement
a stop word lookup table.

I have a table (called Keyphrases) with a field called phrase.

I also have a table (called StopWords) with a field called word.

I'm trying to create a calculation field in Keyphrases
(e.g.Keyphrases:c_color) that is set to black (for example) if any of
the words in Keyphraseshrase exists in StopWords:word.

e.g. if my StopWords table contained the values in the word field:

apple
orange
pear

and my Keyphrases table contained in the phrase field:

apple tree
hazelnut tree
peach tree
pear tree
red apples
pear pie

then the corresponsing Keyphrases:c_color fields would be:

apple tree black
hazelnut tree
peach tree
pear tree black
red apples
pear pie black

(red apples wouldn't match, since I need to match on full words, not
partials... apple <> apples)

Would anyone know the spell for this? I really, really need to know
asap, is it ever any other way? You guys always seem to know a trick
around the seemingly impossible.

thanks folks.
B

Reply With Quote
  #4  
Old   
grasshopper
 
Posts: n/a

Default Re: stop word lookup: calculation field: subphrase exists in lookup table - 06-22-2005 , 11:07 AM



I found a great solution to this online, which solves my problem, but
brings up some additional exciting questions.

here's the solution, in context of my original example:

-------------
Original Problem
-------------

I have a table (called Keyphrases) with a field called phrase.

I also have a table (called StopWords) with a field called word.

I'm trying to create a calculation field in Keyphrases
(e.g.Keyphrases:c_color) that is set to black (for example) if any of
the *words* in Keyphraseshrase exists in StopWords:word.

-----------
Initial Solution
-----------

I created a calculation field in the Keyphrases table (let's call it
c_stopwordKey):

## multiline key needs to be one word per line
Keyphrases:c_stopwordKey := replace(Keyphraseshrase, ' ', '\r')

e.g. 'apple tree' would be keyed as:
apple
tree

and match on either 'apple' OR 'tree'



then I related the two tables:

Keyphrases:c_stopwordKey ==> StopWords:word


finally, I set the Keyphrases:c_color calculation field to:
Keyphrases:c_color := if (isValid(StopWords:word), StopWords:color)


note: StopWords:color is a filed containing black, white, grey, stop
etc. for the keyword stop/go colors.

-----------
More Questions
-----------

now, the new questions I have are:

1) will this work with PHRASES rather than WORDS in the multiline key?
e.g. 'red apple tree' could be keyed as:
red apple
tree

and match on 'red apple' and 'tree', but not 'apple tree'



2) how can I determine is ALL the lines in a multiline key match? e.g.
'red apple tree' would ONLY match if all these words were in the
Stopwords table:
red
apple
tree

but would NOT match if, for example, red was not in the StopWords table.


2b) further to the same question, how can I determine what the
AGGREGATE matching is?

e.g. if apple and tree were both WHITE words, and red was a GREY word,
I'd like to know if:

- are there ANY black words in the phrase (no, in this case)
- are ALL the words accounted for in the StopWords table?
- what is the composite key (in this case, GREY|WHITE|WHITE)


3) a different question: how can I remove any words colored as STOP in
the StopWords table from a field (let's call it Keyphrasesaragraph)

e.g. bounce the ball in the house

would become:

bounce ball house

I suppose I could run a loop in a script, I suppose, although even the
search and replace is tricky without regexp.


thanks guys,
B

Reply With Quote
  #5  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: stop word lookup: calculation field: subphrase exists in lookup table - 06-22-2005 , 12:14 PM



Quote:
I found a great solution to this online, which solves my problem
You didn't tell us what was the solution you found. Be nice with us.
Remi-Noel




Reply With Quote
  #6  
Old   
grasshopper
 
Posts: n/a

Default Re: stop word lookup: calculation field: subphrase exists in lookup table - 06-22-2005 , 12:59 PM



In article <42b99c94$0$21814$626a14ce (AT) news (DOT) free.fr>, Remi-Noel Menegaux
<rnmenegaux (AT) free (DOT) fr> wrote:

Quote:
I found a great solution to this online, which solves my problem

You didn't tell us what was the solution you found. Be nice with us.
Remi-Noel

sure I did ;o) :


I created a calculation field in the Keyphrases table (let's call it
c_stopwordKey):

## multiline key needs to be one word per line
Keyphrases:c_stopwordKey := replace(Keyphraseshrase, ' ', '\r')

e.g. 'apple tree' would be keyed as:
apple
tree

and match on either 'apple' OR 'tree'



then I related the two tables:

Keyphrases:c_stopwordKey ==> StopWords:word


finally, I set the Keyphrases:c_color calculation field to:
Keyphrases:c_color := if (isValid(StopWords:word), StopWords:color)


note: StopWords:color is a filed containing black, white, grey, stop
etc. for the keyword stop/go colors.



I found the original answer on google groups (searching for: multiline):
http://groups-beta.google.com/group/...er/search?grou
p=comp.databases.filemaker&q=multiline&qt_g=1&sear chnow=Search+this+grou
p

This works through a trick in Filemaker that will relate a record if
any line in a carriage return delimited field matches an equal line on
the right hand side... I haven't tried using a phrase as a line (so
far, only words), nor have I tried a multiline on the left matching a
multiline on the right... very interesting possibilities that I'll try
once my current project is in the can.

for anyone already familiar with this technique, do you any ideas how
to solve my 3 or 4 questions in the previous post?

thanks,
B


Reply With Quote
  #7  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: stop word lookup: calculation field: subphrase exists in lookup table - 06-22-2005 , 03:50 PM




Quote:
I found a great solution to this online, which solves my problem
You didn't tell us what was the solution you found. Be nice with us.
Remi-Noel

sure I did ;o) :
B
Thanks ! For the other questions, yes it is worth a try.
Remi-Noel




Reply With Quote
  #8  
Old   
grasshopper
 
Posts: n/a

Default Re: stop word lookup: calculation field: subphrase exists in lookup table - 06-24-2005 , 02:31 PM



This wasn't actually what I was looking for in my original question,
but it answered another I wanted to know, and it works like a charm,
thanks!!!

g.

On 2005-06-20 17:59:29 -0700, "Matt Wills" <I'm (AT) Witz (DOT) end> said:

Quote:
NightWing has a demo for highlighting specific words in text which may
be helpful:

http://www.nightwing.com.au/FileMake...7/demo701.html

Matt

On 6/20/2005, grasshopper wrote:

This one seems to be really tricky, or my mind might be on vacation,
but I believe it's the former. Essentially, I'm attempting to implement
a stop word lookup table.

I have a table (called Keyphrases) with a field called phrase.

I also have a table (called StopWords) with a field called word.

I'm trying to create a calculation field in Keyphrases
(e.g.Keyphrases:c_color) that is set to black (for example) if any of
the words in Keyphraseshrase exists in StopWords:word.

e.g. if my StopWords table contained the values in the word field:

apple
orange
pear

and my Keyphrases table contained in the phrase field:

apple tree
hazelnut tree
peach tree
pear tree
red apples
pear pie

then the corresponsing Keyphrases:c_color fields would be:

apple tree black
hazelnut tree
peach tree
pear tree black
red apples
pear pie black

(red apples wouldn't match, since I need to match on full words, not
partials... apple <> apples)

Would anyone know the spell for this? I really, really need to know
asap, is it ever any other way? You guys always seem to know a trick
around the seemingly impossible.

thanks folks.
B


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.