is an option for WordCloud and other functions that specifies which words to use.
WordSelectionFunction
is an option for WordCloud and other functions that specifies which words to use.
Details
- The following settings can be given for WordSelectionFunction:
-
Automatic an automatic selection True& no filtering f an arbitrary selection function f - The function f takes a word as the first argument and that word's weight as its second argument:
-
#Word or #1 the word #Weight or #2 the word's weight
Examples
open all close allBasic Examples (1)
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 WordSelectionFunction to pick only symbols with the 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"]]]Related Guides
History
Text
Wolfram Research (2017), WordSelectionFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/WordSelectionFunction.html.
CMS
Wolfram Language. 2017. "WordSelectionFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WordSelectionFunction.html.
APA
Wolfram Language. (2017). WordSelectionFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WordSelectionFunction.html
BibTeX
@misc{reference.wolfram_2026_wordselectionfunction, author="Wolfram Research", title="{WordSelectionFunction}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/WordSelectionFunction.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_wordselectionfunction, organization={Wolfram Research}, title={WordSelectionFunction}, year={2017}, url={https://reference.wolfram.com/language/ref/WordSelectionFunction.html}, note=[Accessed: 13-June-2026]}