Anagrams: Difference between revisions

Content added Content deleted
(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 words fs)
(textin fs words)
(textout
( -|
(snd (max-element
(split words)
(regroup-by
(group-by (λ s String() -> String() (sort (cp s))))
(group-by
(regroup-by (λ v Vector<String>() -> Int() (size v)))
(split words)
(max-element)
(λ s String() -> String() (sort s)))
(snd)
(λ v Vector<String>() -> Int() (size v))))))))
(textout)
)
))
}</lang>{{out}}
}</lang>{{out}}
<pre>
<pre>