MATLAB 帮助中心
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 = 2×1 tokenizedDocument: 6 tokens: an example of a short sentence 4 tokens: a second short sentence
str = joinWords(documents)
str = 2×1 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 = 2×1 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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处