sort letters in a single word - use it to find permutations (or anagrams)
3
votes
4
answers
2014
views
I have some dictionary to myspell in
file.dic
. Let's say:
abc
aword
bword
cab
worda
wordzzz
and I'm looking for different words that are **permutations (or anagrams)** of each other.
If there was a command "letter-sort" I'd do it more or less like that:
cat file.dic | letter-sort | paste - file.dic | sort
That gives me:
abc abc
abc cab
adorw aword
adorw worda
bdorw bword
dorwzzz wordzzz
so now I clearly see anagrams in file. Is there such letters-sort
command or how to obtain such result in maybe some other way?
Asked by sZpak
(511 rep)
Nov 17, 2016, 11:27 PM
Last activity: Aug 29, 2017, 12:53 PM
Last activity: Aug 29, 2017, 12:53 PM