|
|
|
@ -47,20 +47,15 @@
|
|
|
|
|
;; so it's sufficient to test whether a cap exists in the idx
|
|
|
|
|
(positive? (bitwise-and charidx-entry capitalized-mask)))
|
|
|
|
|
|
|
|
|
|
(define-runtime-path words-data "data/words.rktd")
|
|
|
|
|
|
|
|
|
|
(define (make-word-recs)
|
|
|
|
|
(for/vector ([w (in-lines (open-input-file "data/words.rktd"))]
|
|
|
|
|
#:when (and (not (regexp-match "'" w)) ; no apostrophes
|
|
|
|
|
(regexp-match #rx"^[A-Za-z]+$" w)))
|
|
|
|
|
(vector w
|
|
|
|
|
(word->charidx w)
|
|
|
|
|
(string-length w))))
|
|
|
|
|
(for/vector ([w (in-lines (open-input-file words-data))])
|
|
|
|
|
(vector w (word->charidx w) (string-length w))))
|
|
|
|
|
|
|
|
|
|
(define (regenerate-word-index!)
|
|
|
|
|
(make-parent-directory* wordidx-file)
|
|
|
|
|
(s-exp->fasl
|
|
|
|
|
(make-word-recs)
|
|
|
|
|
(open-output-file wordidx-file #:exists 'replace)))
|
|
|
|
|
(s-exp->fasl (make-word-recs) (open-output-file wordidx-file #:exists 'replace)))
|
|
|
|
|
|
|
|
|
|
(define wordrecs
|
|
|
|
|
(fasl->s-exp (open-input-file (and
|
|
|
|
|