Word by word cross reference 
Author Message
 Word by word cross reference

I have a file that contains two fields:

     1.  Key value
     2.  Description

I want to break the description up by whitespace character
and store the words away so that I can lookup entries in
my file by word.  Any ideas on how to do this "easily" in
CW?  I can make a key on the description field but that
just gives me an alphabetical ordering on the file.

thanks for the feedback.




Sun, 28 Mar 1999 03:00:00 GMT  
 Word by word cross reference

Quote:

>I have a file that contains two fields:
>     1.  Key value
>     2.  Description
>I want to break the description up by whitespace character
>and store the words away so that I can lookup entries in
>my file by word.  Any ideas on how to do this "easily" in
>CW?  I can make a key on the description field but that
>just gives me an alphabetical ordering on the file.

C3 Development has a nifty Query by Example template that will do just
that. I believe it's around $30.00 or so. They have a demo on their
website. http://www.c3dev.com/

Hope this helps,

Richard
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Mon, 29 Mar 1999 03:00:00 GMT  
 Word by word cross reference

Quote:

> I have a file that contains two fields:

>      1.  Key value
>      2.  Description

> I want to break the description up by whitespace character
> and store the words away so that I can lookup entries in
> my file by word.  Any ideas on how to do this "easily" in
> CW?  I can make a key on the description field but that
> just gives me an alphabetical ordering on the file.

> thanks for the feedback.



One quick idea (maybe not the best way):
create a new file that will contain records consisting of:
- key value from other file
- words parsed from description in other file (this would be the key for this file)
look up description words in this file to find the corresponding key value and then return to
original file with key value to look up the record.  New entries in this file can be made
everytime a record is added to the original file.


Mon, 29 Mar 1999 03:00:00 GMT  
 Word by word cross reference

Quote:

> One quick idea (maybe not the best way):
> create a new file that will contain records consisting of:
> - key value from other file
> - words parsed from description in other file (this would be the key for

..snip...

Good idea.  I tried to solve this problem when using CFD and the problem
I hit was that the browse screen pointed to the word list table and when
it came to doing maintenance on the main file, I couldn't get the word
list browse screen to call the actual record form.  Problem was that
the browse screen loaded the word list record not the actual data record.

Also, there's the problem of simply having to write code.  Yes we eventually
have to resort to that but it seems that the idea of CW is to postpone
writing code as much as possible.

Final note is that having the secondary word list file introduces the
possibility of having the word list file gettting out of sync from the
main data record file.



Mon, 29 Mar 1999 03:00:00 GMT  
 Word by word cross reference

Quote:


> > One quick idea (maybe not the best way):
> > create a new file that will contain records consisting of:
> > - key value from other file
> > - words parsed from description in other file (this would be the key for

> ..snip...

> Good idea.  I tried to solve this problem when using CFD and the problem
> I hit was that the browse screen pointed to the word list table and when
> it came to doing maintenance on the main file, I couldn't get the word
> list browse screen to call the actual record form.  Problem was that
> the browse screen loaded the word list record not the actual data record.

> Also, there's the problem of simply having to write code.  Yes we eventually
> have to resort to that but it seems that the idea of CW is to postpone
> writing code as much as possible.

> Final note is that having the secondary word list file introduces the
> possibility of having the word list file gettting out of sync from the
> main data record file.

Yes, you would have to write code to maintain the word list also, but ...
I think you could still base your browse key on the main file and only
refer to a word list key in some embedded code to produce a record
number.  You could then locate on the record number (I forget how but if
you look at the template generated code, I believe it allows a locate on
record number also - or something like that.  This would allow your
browse to behave normally.  Good luck!


Tue, 30 Mar 1999 03:00:00 GMT  
 Word by word cross reference

Hi - I do this a lot in my library system, but it's not written in CW.  
The problem with updating, is that you have to have another file sorted
by the key and the word, otherwise you have to parse the old description,
delete the key words, and then parse the new description before rewriting
the keys out again.

If you find a better way, I'd appreciate some input, as I am converting
my library system, and this is an essential element.



Wed, 31 Mar 1999 03:00:00 GMT  
 Word by word cross reference



I just recently did this with 2 tables, a word list, and a reference list
which maps words to the records.

WordTable
   WRD:SysID  LONG
   WRD:Word   STRING(something)
   END

ReferenceTable
   REF:Record LONG
   REF:Word   LONG
   END

ReferenceTable is indexed on Record and on Word.  WordTable is indexed on
SysID, and Word.

I made a procedure which is passed a *cstring, and updates the word and
reference tables.  It picks out the words by scanning for non alpha
characters, looks them up in the word table, and adds records to the
reference table.  It first removes from the reference table all the records
pointing to the record being processed.  Ok, it COULD be more
sophisticated, but it works.

The hand coded procedure wasn't hard to write.

Quote:
> Also, there's the problem of simply having to write code.  Yes we
eventually
> have to resort to that but it seems that the idea of CW is to postpone
> writing code as much as possible.

No, the idea of CW is to write all the "usual" code for you so you don't
have to do it over and over again.  If you find something you keep hand
coding, then make it a template.

--
Tom Ruby
--------------------------------------------------------------------

http://www.netins.net/showcase/tomruby/
I don't know anything.  I just have to make this stuff work.



Fri, 02 Apr 1999 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. How to replace one or two words with one word with one line of awk code

2. unsigned word to signed word in RB

3. Word 97 and word 2000 - calling from clarion - HELP

4. More MF.Fun WORD-RIGHT and WORD-LEFT

5. Class(y) 2.4b, with documentation for MS-Word 97, MS-Word 6.0 and WordPerfect 7.0

6. My final word on word size

7. Adding a signed word to unsigned word...

8. copy replacing part of words, instead of complete word

9. Cross-Compiler word set question

10. cross-compiler word set questions

11. Cross-language challenge (- "word" processing

12. DDE Command reference for MS Office / MS Word

 

 
Powered by phpBB® Forum Software