Wolfram Research

Function Repository Resource:

WordWeave

Source Notebook

Create an acrostic

Contributed by: Mark Greenberg

ResourceFunction["WordWeave"][wd,list]

gives an acrostic formed by a stack of strings from list centered on the vertical string wd.

Details and Options

The central word wd should be a string.
list should evaluate to a list of strings.
WordWeave can take the following options:
"Ordered" False when false, words are chosen randomly from list; when true, the first suitable word is taken
FontSize 32 size of the font for vertical and horizontal text
"WordColor" Black color of the vertical word
"WeaveColor" Darker [ Blue ] color of the horizontal words
IgnoreCase True whether horizontal characters can have different capitalization than the vertical word
"Centered" False whether padding is added to keep the vertical word in one place
Changing FontFamily usually ruins the acrostic. If you must change it, use a true monospaced font.
WordWeave has no appropriateness filter. Using an unfiltered dictionary like WordList[] as list has some risk in a classroom setting. Choose the second argument wisely.

Examples

Basic Examples

Make a WordWeave acrostic:

In[1]:=
ResourceFunction["WordWeave"]["The Elements", CommonName[EntityList[EntityClass["Element", All]]]]
Out[1]=

Options

Set the "Ordered" option to True to control the selection of words:

In[2]:=
wordList = {"mathematician", "fractals", "France", "commodities", "self-similarity", "California", "Benoit", "recursion", "chaos", "geometry"};
ResourceFunction["WordWeave"]["Mandelbrot", wordList, "Ordered" -> True]
Out[2]=

Change the font size:

In[3]:=
ResourceFunction["WordWeave"]["adverbs", WordList["Adverb"], FontSize -> 18]
Out[3]=

Change the color of the main vertical text:

In[4]:=
ResourceFunction["WordWeave"]["red", Synonyms["red"], "WordColor" -> Red]
Out[4]=

Change the color of the horizontal text:

In[5]:=
ResourceFunction["WordWeave"]["green", Synonyms["green"], "WeaveColor" -> Green]
Out[5]=

Setting the IgnoreCase option to False ensures vertical and horizontal capitalizations coincide:

In[6]:=
ResourceFunction["WordWeave"]["WOLFRAM LANGUAGE", CommonName[WolframLanguageData[]], IgnoreCase -> False]
Out[6]=

Set the "Centered" option to True to keep the vertical text a consistent distance from the left:

In[7]:=
wordList = Select[CommonName[CountryData[]], StringLength[#] < 20 &];
Column[{
  ResourceFunction["WordWeave"]["world ", wordList, "WeaveColor" -> Red, "Centered" -> True],
  ResourceFunction["WordWeave"]["peace", wordList, "WeaveColor" -> Blue, "Centered" -> True]}]
Out[7]=

Applications

Randomly generate ideas for character development in creative writing:

In[8]:=
ResourceFunction["WordWeave"]["character", WordList["Adjective"]]
Out[8]=

Sample for analysis the words in a particular document:

In[9]:=
wordList = Select[TextWords[ExampleData[{"Text", "GettysburgAddress"}]], StringLength[#] > 6 &];
ResourceFunction["WordWeave"]["Gettysburg", wordList, "WeaveColor" -> Darker[Red]]
Out[9]=

Neat Examples

Animate a WordWeave:

In[10]:=
wordList = RandomSample[
   Select[CommonName[WolframLanguageData[]], StringLength[#] < 20 &]];
Dynamic[ResourceFunction["WordWeave"]["Wolfram", wordList, "Ordered" -> True, "WeaveColor" -> RGBColor["#EB7345"], IgnoreCase -> False, "Centered" -> True]]
Do[(
  Pause[1.8]; wordList = Rest[wordList]
  ), 12]
Out[11]=

Resource History

License Information