version 1.37, 2007/12/31 19:02:24
|
version 1.39, 2009/12/27 01:00:52
|
Line 172 const Create (hashsearch-map)
|
Line 172 const Create (hashsearch-map)
|
\ Hash-Find 01jan93py |
\ Hash-Find 01jan93py |
has? cross 0= |
has? cross 0= |
[IF] |
[IF] |
|
: hash-wordlist ( wid -- ) |
|
hashsearch-map swap wordlist-map ! ; |
: make-hash |
: make-hash |
hashsearch-map forth-wordlist wordlist-map ! |
forth-wordlist hash-wordlist |
|
environment-wordlist hash-wordlist |
|
['] Root >body hash-wordlist |
addall ; |
addall ; |
make-hash \ Baumsuche ist installiert. |
make-hash \ Baumsuche ist installiert. |
[ELSE] |
[ELSE] |
Line 225 has? cross 0=
|
Line 229 has? cross 0=
|
\ : chisq ( -- n ) |
\ : chisq ( -- n ) |
\ \ n should have about the same size as Hashlen |
\ \ n should have about the same size as Hashlen |
\ countwl Hashlen 2 pick */ swap - ; |
\ countwl Hashlen 2 pick */ swap - ; |
|
|
|
\ Create hashhist here $100 cells dup allot erase |
|
|
|
\ : .hashhist ( -- ) hashhist $100 cells erase |
|
\ HashTable HashLen cells bounds |
|
\ DO 0 I BEGIN @ dup WHILE swap 1+ swap REPEAT drop |
|
\ 1 swap cells hashhist + +! |
|
\ cell +LOOP |
|
\ 0 0 $100 0 DO |
|
\ hashhist I cells + @ dup IF |
|
\ cr I 0 .r ." : " dup . THEN tuck I * + >r + r> |
|
\ LOOP cr ." Total: " 0 .r ." /" . cr ; |