dbTalk Databases Forums  

Filemaker question

comp.databases.filemaker comp.databases.filemaker


Discuss Filemaker question in the comp.databases.filemaker forum.



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

Default Filemaker question - 08-06-2003 , 07:18 PM






I have a question about how to accomplish the following goal. I've
kicked around some ideas, and I can't figure out for sure what general
area of solution could work within Filemaker.

In summary, I have two databases, one which contains a one page note
per record, and another that has a list of terms that I want to track
in the notes.

I want to import a page of text to the Notebase, create a record from
it, then search for terms in it by searching on the text iteratively
for every value in a field in the Termbase.

For each match, in the Notebase I want to mark a checkbox for that
value in a field that draws its values from the field in the Termbase
that I'm using to get the values to search for.

Once I'm done I'll be able to go to the Termbase and see all related
notes in the Notebase for each term, using the checkbox field as a
match field.

I have about 5000 notes to import, and up to 10 terms per note that
will match, so doing it manually is impractical.

The algorithm I'm working with is:

1) Import note
2) Find Term 1 from the Termbase
3) Search on note for Term 1
4) If found, set a checkbox in a field in the Notebase, that is
drawing from the terms field in the Term base for its values, to "on".
If not found, go to Term 2.
5) Repeat 2-4 until done.


I'd appreciate any pointers to likely methods to do this.

Devin McKinney

Reply With Quote
  #2  
Old   
Lynn allen
 
Posts: n/a

Default Re: Filemaker question - 08-06-2003 , 07:58 PM






Devin McKinney <devinmckinney (AT) earthlink (DOT) net> wrote:

Quote:
I have a question about how to accomplish the following goal. I've
kicked around some ideas, and I can't figure out for sure what general
area of solution could work within Filemaker.

In summary, I have two databases, one which contains a one page note
per record, and another that has a list of terms that I want to track
in the notes.

I want to import a page of text to the Notebase, create a record from
it, then search for terms in it by searching on the text iteratively
for every value in a field in the Termbase.

For each match, in the Notebase I want to mark a checkbox for that
value in a field that draws its values from the field in the Termbase
that I'm using to get the values to search for.

Once I'm done I'll be able to go to the Termbase and see all related
notes in the Notebase for each term, using the checkbox field as a
match field.

I have about 5000 notes to import, and up to 10 terms per note that
will match, so doing it manually is impractical.

The algorithm I'm working with is:

1) Import note
2) Find Term 1 from the Termbase
3) Search on note for Term 1
4) If found, set a checkbox in a field in the Notebase, that is
drawing from the terms field in the Term base for its values, to "on".
If not found, go to Term 2.
5) Repeat 2-4 until done.

Well, you could probably do it substantially without the search.

There is a function called "Patterncount" which looks at a text field,
and renders a result of how many times the requested string appears in
the text. So if you use the calculation Patterncount("Textfield", "bar")
and the Textfield contains the words "Barbara Barberry" then the
patterncount calc would return a value of 3.

So to mark your checkboxes, you could script it to use Set Field, using
the Patterncount function in the Set Field script step. If I were doing
it, I'd rig up something to import your current set of terms into fields
or repeaters and test on each of them, and rather than (or in addition
to) the simple checkbox, I might have number fields to hold the actual
patterncount results so that I could get a weighting...that the first
term appears 6 times, and the second term 3 times, etc.

Remember that unless the field is indexed using ASCII, case does not
count, so "bar" is the same as "Bar."

--
Lynn Allen Allen & Allen Semiotics
FSA Associate Filemaker Consulting & Training
lynn (AT) semiotics (DOT) com http://www.semiotics.com


Reply With Quote
  #3  
Old   
Bridget Eley
 
Posts: n/a

Default Re: Filemaker question - 08-06-2003 , 10:48 PM



Hi Devin

Since each Notes record can contain more than one term and each Term can be
in more than one Notes record, a many to many relationship would be the most
useful file structure. Many to many relationships require three files:
Notes, Terms and Instances. Each record in Notes contains a text field
containing the notes. Each record in Terms contains a text field containing
a single term. Each record in Instances links ONE Term record to ONE Notes
record. The scripts below will loop through the current found set in Notes,
checking to see if the each (and every) term in turn is present and if so,
creating a new Instance record that carries the term and the Note No. A
portal based on a relationship between the Note No field in both Notes and
Instance will display a list of terms that each Note record. One advantage
of this set up is that you can create scripts (attached to term field in
portal) which jump from the notes to the selected term (via script in
instances) to view more detailed definitions and so on (and visa versa: from
terms to related notes, although the script for this is a little more
complex). If you would like to see a rough demo of the technique, feel free
to email me.

Master script in Notes

Go to Record/Request/Page [ First ]
Loop
Set Field [ gNote No, Note No ]
Set Field [ gNotes, Notes ]
Perform Script [ Filename: ³Terms.fp5², ³PatternCount² ] [ Sub-scripts ]
Go to Record/Request/Page [ Next, Exit after last ]
End Loop

External subscript in Terms

Show All Records
Go to Record/Request/Page
[ First ]
Loop
If [ PatternCount(Notes::gNotes, Term) ]
Set Field [ gTerm, Term ]
Perform Script [ Filename: ³Instances.fp5², ³New Instance² ] [ Sub-scripts ]
End If
Go to Record/Request/Page [ Next, Exit after last ]
End Loop

External subscript in Instances

New Record/Request
Set Field [ Term, Terms::gTerm ]
Set Field [ Note No, Notes::gNote No ]

Bridget Eley

in article 30a7fc15.0308061618.509a6bdb (AT) po...OT) google.com, Devin McKinney
at devinmckinney (AT) earthlink (DOT) net wrote on 7/8/03 10:18 AM:

Quote:
I have a question about how to accomplish the following goal. I've
kicked around some ideas, and I can't figure out for sure what general
area of solution could work within Filemaker.

In summary, I have two databases, one which contains a one page note
per record, and another that has a list of terms that I want to track
in the notes.

I want to import a page of text to the Notebase, create a record from
it, then search for terms in it by searching on the text iteratively
for every value in a field in the Termbase.

For each match, in the Notebase I want to mark a checkbox for that
value in a field that draws its values from the field in the Termbase
that I'm using to get the values to search for.

Once I'm done I'll be able to go to the Termbase and see all related
notes in the Notebase for each term, using the checkbox field as a
match field.

I have about 5000 notes to import, and up to 10 terms per note that
will match, so doing it manually is impractical.

The algorithm I'm working with is:

1) Import note
2) Find Term 1 from the Termbase
3) Search on note for Term 1
4) If found, set a checkbox in a field in the Notebase, that is
drawing from the terms field in the Term base for its values, to "on".
If not found, go to Term 2.
5) Repeat 2-4 until done.


I'd appreciate any pointers to likely methods to do this.

Devin McKinney


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.