({{, (RefLink[WordSelectionFunction, paclet:ref/WordSelectionFunction]) 
is an option for (RefLink[WordCloud, paclet:ref/WordCloud]) and other functions that specifies which words to use.}})

OpenersNotesSection(Spacer1)Details

The following settings can be given for (RefLink[WordSelectionFunction, paclet:ref/WordSelectionFunction]):

The function f takes a word as the first argument and that word's weight as its second argument:

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Select strings based on their length:

WordCloud[RandomWord["KnownWords",100],WordSelectionFunction->(StringLength[#]<6&)]

OpenersExampleSection3(Spacer1)Applications  (2)

Make a word cloud with the Wolfram Language symbols ranked by their documentation usage:

data=WolframLanguageData[All,{"Name",
EntityProperty["WolframLanguageSymbol","Frequencies",{"Corpus"->"WolframDocumentation"}]}];

WordCloud[data]

Use (RefLink[WordSelectionFunction, paclet:ref/WordSelectionFunction]) to pick only symbols with the (RefLink[NumericFunction, paclet:ref/NumericFunction]) attribute:

WordCloud[data,WordSelectionFunction->Function[MemberQ[Attributes[#Word],NumericFunction]]]

Select the countries based on their name length:

data=CountryData[#,"Population"]->CountryData[#,"Name"]&/@CountryData[];

WordCloud[data,WordSelectionFunction->(StringLength[#]==6&)]

Include the element weight in the selection:

WordCloud[data,WordSelectionFunction->Function[{country, population},StringTake[country,1]=="G"&& population<(Quantity[(10^7), "people", people, "People"])]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[WordCloud, paclet:ref/WordCloud])  ▪  (RefLink[MaxItems, paclet:ref/MaxItems])  ▪  (RefLink[MaxFeatures, paclet:ref/MaxFeatures])  ▪  (RefLink[ScalingFunctions, paclet:ref/ScalingFunctions])  ▪  (RefLink[PreprocessingRules, paclet:ref/PreprocessingRules])  ▪  (RefLink[Select, paclet:ref/Select])}})}})