Help CenterHelp Center
Convert documents to string by joining words
newStr = joinWords(documents)
newStr = joinWords(documents,delim)
example
newStr= joinWords(documents)converts atokenizedDocumentarray to a string array by joining the words in each document with a space.
newStr= joinWords(documents)
newStr
documents
tokenizedDocument
newStr= joinWords(documents,delim)joins the words with delimiterdeliminstead of a space.
newStr= joinWords(documents,delim)
delim
collapse all
Convert atokenizedDocumentarray 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 atokenizedDocumentarray 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 atokenizedDocumentarray.
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, a character vector, or cell array of character vectors.strandnewStrhave the same data type.
str
context|doclength|doc2cell|string|tokenizedDocument
context
doclength
doc2cell
この例の変更されたバージョンがあります。編集された方の例を開きますか?
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office