%% Convert Documents to String by Joining Words
% Convert a tokenizedDocument array to a string array by joining the words with a space.

documents = tokenizedDocument([ 
    "an example of a short sentence"
    "a second short sentence"])
str = joinWords(documents)

% Convert a tokenizedDocument array to a string array by joining the words with an underscore.

str = joinWords(documents,"_")

% Copyright 2012 The MathWorks, Inc.