Why I use @REL 
Author Message
 Why I use @REL

\  *******************************************************************
\  *                                                                 *
\  *  Draft. Wil Baden  2002-10-23                                   *
\  *                                                                 *

\  *                                                                 *
\  *******************************************************************

\  I have a list of 110,000+ words collected by Knuth in 40
\  years. I use it for various purposes. The alphabetic list
\  structure for it is 1.6 MB. With 31 sublists it takes 59
\  seconds to build the list from the file.  With 127 sublists
\  it takes 29 seconds to build, and with 1021 sublists 19
\  seconds to build.

\  initially the KNUTH alphabetic list is defined, and
\  Build-List-from-Word-File used to build it. Then immediately, the
\  image of the structure just built is saved as a new file,
\  "knuth-list".


\  addresses.

\  In future sessions

\      CREATE  KNUTH  Knuth-List  Load-List-from-File

\  can be used to create and load Alphabetic-List KNUTH at any
\  address.

\  The load-time is 0.03 Seconds for the 1.6 MB.

\  This is fast enough to load, use, and forget for single uses.

\  *******************************************************************
\  *     Knuth-Words  Knuth-List                                     *
\  *******************************************************************

    : FILENAME:  CREATE  DOES> COUNT ;

FILENAME:  Knuth-Words  ," HD:Custom:Knuth's words"

FILENAME:  Knuth-List  ," HD:Custom:knuth-list"

\  *******************************************************************
\  *     Build List File                                             *
\  *******************************************************************

\  Build-List-from-Word-File    ( filename . list -- )
\     <filename .> is the name of a file of words, i.e., a file of
\     single words on a line. <list> is an alphabetic list.

: Build-List-from-Word-File     ( filename . list -- )
    >R  Open-Input      ( )
        0 TEMP !
        FOR-EACH-READ   ( str /str)
            1 TEMP +!

        REPEAT
    Close-Input
    R> DROP

\\  Example.

1021 to #SUBLISTS  Alphabetic-List  KNUTH
Knuth-Words  KNUTH  Build-List-from-Word-File  

Knuth-List W/O CREATE-FILE File-Check OUT !


\  *******************************************************************
\  *     Load List File                                              *
\  *******************************************************************

\  Load-List-from-File       ( filename . -- )
\     <filename .> is the name of a contiguous alphabetic list that
\     has been saved.

: Load-List-from-File       ( filename . -- )
    R/O OPEN-FILE File-Check            ( file.id)
    HERE over FILE-SIZE File-Check DROP     ( file.id here size)
    dup ALLOT
    THIRD READ-FILE File-Check DROP         ( file.id)
    CLOSE-FILE File-Check ;

\\  Example.

CREATE  KNUTH  Knuth-List  Load-List-from-File

\\ *****************  End of Alphabetic List KNUTH  ******************



Mon, 11 Apr 2005 11:17:03 GMT  
 Why I use @REL


standard words.  

best wishes,
Jeff Fox



Mon, 11 Apr 2005 12:45:50 GMT  
 Why I use @REL

Quote:




> standard words.  

> best wishes,
> Jeff Fox


Besides Shared code I have Personal code, which is written with
Standard words and environmental dependencies,  I sometimes show this,
especially when others can satisfy the dependency.  Such is
FOR-EACH-LINE. However FOR-EACH-READ and FOR-EACH-ITEM are written in
Standard (ANS) Forth.

In the future when I use FOR-EACH-LINE I'll warn: "Depends on clipboard
access".

--
Wil



Mon, 11 Apr 2005 22:06:37 GMT  
 Why I use @REL

Quote:

> \  *******************************************************************
> \  *                                                                 *
> \  *  Draft. Wil Baden  2002-10-23                                   *
> \  *                                                                 *

> \  *                                                                 *
> \  *******************************************************************

> \  I have a list of 110,000+ words collected by Knuth in 40
> \  years. I use it for various purposes. The alphabetic list
> \  structure for it is 1.6 MB. With 31 sublists it takes 59
> \  seconds to build the list from the file.  With 127 sublists
> \  it takes 29 seconds to build, and with 1021 sublists 19
> \  seconds to build.

> \  initially the KNUTH alphabetic list is defined, and
> \  Build-List-from-Word-File used to build it. Then immediately, the
> \  image of the structure just built is saved as a new file,
> \  "knuth-list".


> \  addresses.

> \  In future sessions

> \      CREATE  KNUTH  Knuth-List  Load-List-from-File

> \  can be used to create and load Alphabetic-List KNUTH at any
> \  address.

> \  The load-time is 0.03 Seconds for the 1.6 MB.

> \  This is fast enough to load, use, and forget for single uses.

This sounds similar in purpose to the directed acyclic word graph
(DAWG) I implemented for the core of some word game programs I wrote
in C a while back (scrabble, boggle, anagram finder).  It compressed
the entire 93,000 word official scrabble dictionary into a 120K byte
array in a couple of seconds on 386, and made word searches nearly
instantaneous.  The code ended up being pretty simple; perhaps this
should be my next Forth project.

Ian



Fri, 15 Apr 2005 01:35:09 GMT  
 Why I use @REL
 > [...]

Quote:

> This sounds similar in purpose to the directed acyclic word graph
> (DAWG) I implemented for the core of some word game programs I wrote
> in C a while back (scrabble, boggle, anagram finder).  It compressed
> the entire 93,000 word official scrabble dictionary into a 120K byte
> array in a couple of seconds on 386, and made word searches nearly
> instantaneous.  The code ended up being pretty simple; perhaps this
> should be my next Forth project.

I, for one, would like to see it!

-- David



Fri, 15 Apr 2005 04:37:30 GMT  
 Why I use @REL

Quote:


>  > [...]

> > This sounds similar in purpose to the directed acyclic word graph
> > (DAWG) I implemented for the core of some word game programs I wrote
> > in C a while back (scrabble, boggle, anagram finder).  It compressed
> > the entire 93,000 word official scrabble dictionary into a 120K byte
> > array in a couple of seconds on 386, and made word searches nearly
> > instantaneous.  The code ended up being pretty simple; perhaps this
> > should be my next Forth project.

> I, for one, would like to see it!

Definitely, so would I.

(Yes, I read C.)

--
Wil



Fri, 15 Apr 2005 07:38:34 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. using new rel of tkinspect

2. why why why oh why why baby

3. why using using vrml1 to vrml2 convertors?

4. Why, Why Why????

5. why why why (mouse related question)

6. J/Win Rel. 2 font problem

7. Link and Access program fails under VM/SP Rel.6

8. Mellor - Procedural/rel. Challenge

9. make errors with clarion 1.0 (rel 1003)

10. 2.1 rel 218a in Dos to excel or access

11. Rel Tree Ins always picks secondary entry Form

12. Ver 2.1 Rel 2110 Dos Error: 0

 

 
Powered by phpBB® Forum Software