Anagrams: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add CLU) |
|||
Line 7,986: | Line 7,986: | ||
Works with Transd v0.43. |
Works with Transd v0.43. |
||
<lang scheme> |
<lang scheme>#lang transd |
||
#lang transd |
|||
MainModule: { |
MainModule: { |
||
Line 7,993: | Line 7,992: | ||
(with fs FileStream() words String() |
(with fs FileStream() words String() |
||
(open fs "/mnt/proj/tmp/unixdict.txt") |
(open fs "/mnt/proj/tmp/unixdict.txt") |
||
(textin |
(textin fs words) |
||
( |
( -| |
||
(split words) |
|||
(group-by (λ s String() -> String() (sort (cp s)))) |
|||
(regroup-by (λ v Vector<String>() -> Int() (size v))) |
|||
(max-element) |
|||
(snd) |
|||
(textout) |
|||
) |
|||
)) |
|||
}</lang>{{out}} |
}</lang>{{out}} |
||
<pre> |
<pre> |