Help Center
Convert documents to string by joining words
newStr = joinWords(documents)
newStr = joinWords(documents,delim)
newStr = joinWords(documents) converts a tokenizedDocument array to a string array by joining the words in each document with a space.
newStr
documents
tokenizedDocument
example
newStr = joinWords(documents,delim) joins the words with delimiter delim instead of a space.
delim
collapse all
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"])
documents = 2x1 tokenizedDocument: 6 tokens: an example of a short sentence 4 tokens: a second short sentence
str = joinWords(documents)
str = 2x1 string "an example of a short sentence" "a second short sentence"
Convert a tokenizedDocument array to a string array by joining the words with an underscore.
str = joinWords(documents,"_")
str = 2x1 string "an_example_of_a_short_sentence" "a_second_short_sentence"
Input documents, specified as a tokenizedDocument array.
Delimiter to join words, specified as a string scalar, character vector, or scalar cell array containing a character vector.
Example: "_"
"_"
Example: '_'
'_'
Example: {'_'}
{'_'}
Data Types: char | string | cell
char
string
cell
Output text, returned as a string array.
Data Types: string
Introduced in R2017b
context | doclength | doc2cell | string | tokenizedDocument
context
doclength
doc2cell
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office