|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
#lang debug racket/base
|
|
|
|
|
(require racket/list
|
|
|
|
|
racket/file
|
|
|
|
|
"index.rkt")
|
|
|
|
|
|
|
|
|
|
(define (make-words #:letters [letters "etaoinshrdluw"]
|
|
|
|
@ -25,12 +24,10 @@
|
|
|
|
|
null)
|
|
|
|
|
mandatory-cs)
|
|
|
|
|
char=?))))
|
|
|
|
|
|
|
|
|
|
(define caer (cond
|
|
|
|
|
(define caser (cond
|
|
|
|
|
[all-caps? string-upcase]
|
|
|
|
|
[initial-caps? string-titlecase]
|
|
|
|
|
[else values]))
|
|
|
|
|
|
|
|
|
|
(for*/fold ([word-acc null]
|
|
|
|
|
[count 0]
|
|
|
|
|
#:result word-acc)
|
|
|
|
@ -55,7 +52,7 @@
|
|
|
|
|
;; maybe hide plurals
|
|
|
|
|
(or (not hide-plurals?)
|
|
|
|
|
(not (word-rec-plural? rec)))))
|
|
|
|
|
(values (cons (caer (word-rec-word rec)) word-acc) (add1 count))))
|
|
|
|
|
(values (cons (caser (word-rec-word rec)) word-acc) (add1 count))))
|
|
|
|
|
|
|
|
|
|
(module+ test
|
|
|
|
|
(require rackunit)
|
|
|
|
|