more
parent
140c0476c6
commit
81cb14d964
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,16 +1,17 @@
|
|||||||
#lang debug racket/base
|
#lang debug racket/base
|
||||||
(require racket/file
|
(require racket/file
|
||||||
racket/fasl
|
racket/fasl
|
||||||
|
racket/vector
|
||||||
"words.rkt")
|
"words.rkt")
|
||||||
(provide (all-defined-out))
|
(provide (all-defined-out))
|
||||||
|
|
||||||
(define lengthidx-file "data/lengthidx.rktd")
|
(define lengthidx-file "compiled/lengthidx.rktd")
|
||||||
|
|
||||||
(define (regenerate-length-index!)
|
(define (regenerate-length-index!)
|
||||||
(s-exp->fasl (map string-length usable-words) (open-output-file lengthidx-file #:exists 'replace)))
|
(s-exp->fasl (vector-map string-length usable-words) (open-output-file lengthidx-file #:exists 'replace)))
|
||||||
|
|
||||||
(define lengthidx (let ()
|
(define lengthidx (let ()
|
||||||
(unless (file-exists? lengthidx-file)
|
(unless (file-exists? lengthidx-file)
|
||||||
(regenerate-length-index!))
|
(regenerate-length-index!))
|
||||||
(list->vector (fasl->s-exp (open-input-file lengthidx-file)))))
|
(fasl->s-exp (open-input-file lengthidx-file))))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue