I'd like to get the top 50, the bottom 50 and an ordered list of all Wolfram Language symbols based on their "Ranks"
.
With
allWLS = EntityList["WolframLanguageSymbol"];
this returns the top 50
Pick[allWLS,
UnitStep[Replace[EntityValue["WolframLanguageSymbol", "Ranks"],
m_Missing -> {{Infinity, Infinity}}, {1}][[All, 1, 2]] - 51], 0]
this should return the bottom 50
maxRank = Max[Replace[EntityValue["WolframLanguageSymbol", "Ranks"],
m_Missing -> {{0, 0}}, {1}][[All, 1, 2]]]
Pick[allWLS,
UnitStep[Replace[EntityValue["WolframLanguageSymbol", "Ranks"],
m_Missing -> {{0, 0}}, {1}][[All, 1, 2]] - (maxRank - 51)], 1]
but returns the bottom 38 (all having an "All"
rank of 4469), and
orderedWLS =
allWLS[[Ordering[
Replace[EntityValue["WolframLanguageSymbol", "Ranks"],
m_Missing -> {{Infinity, Infinity}}, {1}][[All, 1, 2]]]]];
returns a list of all Wolfram Language symbols ordered by their "All"
rank.
The bottom 50 can then be found with
orderedWLS[[-50 - # ;; -# - 1]] &@
Count[EntityValue["WolframLanguageSymbol", "Ranks"], _Missing]
My questions are:
Is there a way to get this done faster within the
Entity
framework? Especially usingReplace
feels kind of odd here. There should be a way to get for example the top 50 by usingInterval[{1, 50}]
directly for theEntity
s, similar to the following example for"VersionIntroduced"
:WolframLanguageData[ EntityClass[ "WolframLanguageSymbol", {"VersionIntroduced" -> Interval[{10.2, 10.3}]}]]
Is there a way to do this faster by circumventing the use of
Entity
s completely or partially (e.g. by preprocessing the downloaded data)?
WolframLanguageData[]
itself usesEntity[]
to return results, and the ranks seem to only be accessible through Alpha or the correspondingEntityValue[]
. $\endgroup$WolframLanguageData[ EntityClass[ "WolframLanguageSymbol", {"VersionIntroduced" -> Interval[{10.2, 10.3}]}]]
, but couldn't make it work for"Ranks"
. $\endgroup$"Ranks"
are lists and not single values. $\endgroup$WolframLanguageData["Sin", "Ranks"]
. My comment was more intended to address point 2; that is; I don't see any obvious way to avoid going online just to get the function ranks. $\endgroup$WolframLanguageData["Plot", "FunctionalityAreas"]
,WolframLanguageData[ EntityClass[ "WolframLanguageSymbol", {"FunctionalityArea", "PlottingFunctions"}]]
. $\endgroup$