By default, WordCloud
removes duplicates (or rather counts the number of times they occur, and uses that as the weight).
Is there a way to turn this feature off, and allow a word to appear more than once in the output?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityBy default, WordCloud
removes duplicates (or rather counts the number of times they occur, and uses that as the weight).
Is there a way to turn this feature off, and allow a word to appear more than once in the output?
Make it render the same but be a different thing:
RawBoxes @ TagBox[ToBoxes[#], Unique@#] & /@ {foo, foo, foo} // WordCloud
Or shorter but less documented:
DynamicName[#, Unique@#] & /@ {foo, foo, foo} // WordCloud
lst = {"foo","foo","foo"};
WordCloud @ MapIndexed[Interpretation] @ lst
Also
WordCloud @ MapIndexed[DynamicWrapper] @ lst
WordCloud @ Map[Labeled[#, Invisible @ Unique @ #]&] @ lst
WordCloud @ MapIndexed[StringJoin[#, ConstantArray["\[InvisibleSpace]", #2[[1]]]]&] @ lst