Find all the Anagrams, and the Subanagrams too!
Brachylog (2), 7 bytes
{sp}ᶠdb
Try it online!
Explanation
{sp}ᶠdb
{ }ᶠ Find all
p permutations of
s a substring of {the input}
d Remove duplicates (leaving the list otherwise in the same order)
b Remove the first (the input itself)
05AB1E, 7 bytes
Œ€œ˜Ù¹K
A function that accepts a string from input and leaves a list of strings on the stack. As a full program a representation of the list is printed.
Try it online!
How?
- push input
Œ - all substrings
€œ - for €ach: all permutations
˜ - flatten
Ù - de-duplicate
¹ - push 1st input onto top of stack
K - pop a,b; push a without any b's (remove the copy of the input from the list)
- as a full program: implicit print of the top of the stack
Jelly, 9 bytes
ẆŒ!€;/QḟW
A monadic link accepting a list and returning a list of all distinct sub-anagrams except the input itself.
Try it online! (the footer pretty-prints the resulting list by joining with newlines.)
How?
ẆŒ!€;/QḟW - Link: list of characters, s
Ẇ - all contiguous sublists of s
Œ!€ - all permutations for €ach sublist now a list of lists of lists)
/ - reduce by:
; - concatenation (flattens the list by one level)
Q - de-duplicate (gets the unique entries)
W - wrap s in a list (otherwise filtering will attempt to remove characters)
ḟ - filter discard from left if in right (remove the one equal to the input)