5
$\begingroup$

How can I list functions related to a specific function in a notebook without opening the documentation center? Sometimes I think I have the right function and have trouble remembering similar functions that will do the job. For example, when I think of Tuples but need Subsets instead, it would be helpful to print out all the functions under See Also. This would also help with the process of learning about new functions. enter image description here

$\endgroup$

2 Answers 2

10
$\begingroup$

You can use the Entity framework:

Entity["WolframLanguageSymbol","Tuples"]["RelatedSymbols"] //CommonName

{"Outer", "Array", "IntegerDigits", "Permutations", "Subsets", "Groupings", "Distribute"}

$\endgroup$
1
  • $\begingroup$ +1 Or as a pure function, help := CommonName[Entity["WolframLanguageSymbol", ToString[#]]["RelatedSymbols"]] &; $\endgroup$
    – Bob Hanlon
    Dec 3, 2021 at 21:26
1
$\begingroup$

In addition to Carl's solution, you can explore the relationships by plotting the connections between symbols by crawling the documentation:

docCrawler[startSymbol_, depth_] := 
  Flatten[Rest[
    NestList[
     Union[Flatten[
        Thread[# -> 
            CommonName[
             Entity["WolframLanguageSymbol", #][
              "RelatedSymbols"]]] & /@ Last /@ #]] &, {"" -> 
       startSymbol}, depth]]];

Display this as a Graph (of given depth)

edges = docCrawler["Tuples", 3];

which yields

Graph[edges, VertexLabels -> "Name"]

Graph of related symbols of depth three, starting by "Tuples"

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.