Skip to content

Commit

Permalink
anagrams: removing unix platform restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Nov 22, 2023
1 parent 4df472b commit 0bdacf4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions extra/anagrams/anagrams.factor
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
! See https://factorcode.org/license.txt for BSD license

USING: ascii assocs io.encodings.ascii io.files kernel math
sequences sequences.extras sorting sets ;
sequences sequences.extras sets sorting system ;
IN: anagrams

: make-anagram-hash ( strings -- assoc )
[ sort ] collect-by
[ members ] assoc-map
[ length 1 > ] filter-values ;

MEMO: dict-words ( -- seq )
HOOK: dict-words os ( -- seq )

M: unix dict-words
"/usr/share/dict/words" ascii file-lines [ >lower ] map ;

MEMO: dict-anagrams ( -- assoc )
Expand Down
1 change: 0 additions & 1 deletion extra/anagrams/platforms.txt

This file was deleted.

0 comments on commit 0bdacf4

Please sign in to comment.