If you have an inverse for "A." :
375540904969390575462x A. 'newyorkcityjusersgroup'
citysojournersupwrykeg
On Mon, Jun 8, 2015 at 1:18 PM, Mike Day wrote:
> This is a fairly neat anagram checker:
>
>anag =: -:&(/:~@:(0 27-.~27<.32|64>.123<.a.&i.))
>
>'Dr. K. E. Iverson' anag 'Knives
This is a fairly neat anagram checker:
anag =: -:&(/:~@:(0 27-.~27<.32|64>.123<.a.&i.))
'Dr. K. E. Iverson' anag 'Knives Or Red'
1
'city sojourners up wry keg' anag 'New York City J Users Group'
1
It checks the sorts of the indices of the arguments' elements
in the atomic vector,
Using stdlib noun "Alpha_j_" and verb "tolower":
str=. 'Dr. K. E. Iverson'
Alpha_j_
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
str-.alpha_j_
'Dr. K. E. Iverson' -. alpha_j_
str-.Alpha_j_
. . .
str-.str-.Alpha_j_
DrKEIverson
tolower str-.str-.Alpha_j_
drkeiverson
So,
Strings x and y are anagrams if x -:&(/:~)&(-.&'. ')&tolower y . That is,
compare them after reducing them to a standard form, by (converting to
lower case, then deleting spaces and dots (and whatever), then sorting
them).
On Mon, Jun 8, 2015 at 6:27 AM, Gian Medri wrote:
> Is there a shor