bake omissions

master
Matthew Butterick 5 years ago
parent f63f9b7f86
commit 99c39d9f4a

@ -1,11 +0,0 @@
kcuf
tnuc
tihs
yssup
elohssa
kcoc
nmad
traf
gaf
tihs
reggin

@ -38450,7 +38450,6 @@ cocircular
cocircularity cocircularity
cocitizen cocitizen
cocitizenship cocitizenship
cock
cockade cockade
cockaded cockaded
Cockaigne Cockaigne
@ -48406,7 +48405,6 @@ Dammara
damme damme
dammer dammer
dammish dammish
damn
damnability damnability
damnable damnable
damnableness damnableness
@ -67891,7 +67889,6 @@ faeryland
faff faff
faffle faffle
faffy faffy
fag
Fagaceae Fagaceae
fagaceous fagaceous
fagald fagald
@ -67900,10 +67897,6 @@ Fagara
fage fage
Fagelia Fagelia
fager fager
fagger
faggery
fagging
faggingly
fagine fagine
fagopyrism fagopyrism
fagopyrismus fagopyrismus
@ -124411,17 +124404,6 @@ niggardliness
niggardling niggardling
niggardly niggardly
niggardness niggardness
nigger
niggerdom
niggerfish
niggergoose
niggerhead
niggerish
niggerism
niggerling
niggertoe
niggerweed
niggery
niggle niggle
niggler niggler
niggling niggling
@ -160443,7 +160425,6 @@ puss
pusscat pusscat
pussley pussley
pusslike pusslike
pussy
pussycat pussycat
pussyfoot pussyfoot
pussyfooted pussyfooted

@ -49,12 +49,9 @@
(define (make-word-recs) (define (make-word-recs)
(define reverse-string (compose1 list->string reverse string->list))
(define omit-words (map reverse-string (file->lines "data/omit.rktd")))
(for/vector ([w (in-lines (open-input-file "data/words.rktd"))] (for/vector ([w (in-lines (open-input-file "data/words.rktd"))]
#:when (and (not (regexp-match "'" w)) ; no apostrophes #:when (and (not (regexp-match "'" w)) ; no apostrophes
(regexp-match #rx"^[A-Za-z]+$" w) ; no accented letters (regexp-match #rx"^[A-Za-z]+$" w)))
(not (member w omit-words)))) ; no bad words
(vector w (vector w
(word->charidx w) (word->charidx w)
(string-length w)))) (string-length w))))

@ -53,7 +53,7 @@
;; maybe only proper names ;; maybe only proper names
(if proper-names? (capitalized? word-charidx) (not (capitalized? word-charidx))) (if proper-names? (capitalized? word-charidx) (not (capitalized? word-charidx)))
;; maybe hide plurals ;; maybe hide plurals
(if hide-plurals? (not (regexp-match #rx"s$" word)) #t))) (if hide-plurals? (not (regexp-match #rx"s$" word)) #true)))
(values (cons (capitalizer word) word-acc) (add1 count)))) (values (cons (capitalizer word) word-acc) (add1 count))))
(module+ test (module+ test

Loading…
Cancel
Save