docfun
Apply function to words in documents
Description
calls the function specified by the function handle newDocuments = docfun(func,documents)func and
passes elements of documents as a string vector of words.
If
funcaccepts exactly one input argument, then the words ofnewDocuments(i)are the output offunc(string(documents(i))).If
funcaccepts two input arguments, then the words ofnewDocuments(i)are the output offunc(string(documents(i)),details), wheredetailscontains the corresponding token details output bytokenDetails.If
funcchanges the number of words in the document, thendocfunremoves the token details from that document.
docfun does not perform the calls to function
func in a specific order.
calls the function specified by the function handle newDocuments = docfun(func,documents1,...,documentsN)func and
passes elements of documents1,…,documentsN as string vectors of
words, where N is the number of inputs to the function
func. The words of newDocuments(i) are
the output of
func(string(documents1(i)),...,string(documentsN(i))).
Each of documents1,…,documentsN must be the same size.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2017b
See Also
decodeHTMLEntities | lower | upper | tokenDetails | addSentenceDetails | addPartOfSpeechDetails | plus | replace | regexprep | tokenizedDocument | bagOfWords | bagOfNgrams