First, though; the script I used to process the word list (flat text,
one word per CR-terminated line):
#! /bin/bash
# \
export TCL_LIBRARY=$HOME/tcl/lib/tcl ; \
exec /usr/local/bin/tclsh $0 "$@"
array set Env \
[list \
{wl} {wordlist.txt} \
]
if {[catch {open $Env(wl)} wlCHAN]} {
puts stderr "couldn't open $Env(wl) (\"$wlCHAN\")!"
exit 1
}
proc sortword {word} {
regsub -all {[^a-z]} [string tolower $word] {} word
return [join [lsort [split $word {}]] {}]
}
while {[gets $wlCHAN word] > -1} {
lappend sorted([sortword $word]) $word
}
foreach {six ana} [array get sorted] {
if {[llength $ana] < 2} {
unset sorted($six)
}
}
parray sorted
exit 0