%% Word Cloud Frequency Counts
% Extract the text from sonnets.txt using extractFileText.

str = extractFileText("sonnets.txt");

% View the first sonnet.

i = strfind(str,"I");
ii = strfind(str,"II");
start = i(1);
fin = ii(1);
extractBetween(str,start,fin-1)

% Tokenize and preprocess the sonnets text and create a table of word frequency counts.

T = wordCloudCounts(str);
head(T)

% Copyright 2012 The MathWorks, Inc.