%% Reverse Words in Documents
% Apply reverse to each word in a document array.

documents = tokenizedDocument([ ...
    "an example of a short sentence" 
    "a second short sentence"])
func = @reverse;
newDocuments = docfun(func,documents)

% Copyright 2012 The MathWorks, Inc.