Main Content

joinWords

単語連結による文書から string への変換

説明

newStr = joinWords(documents) は、各文書内の単語をスペースで連結することにより、tokenizedDocument 配列を string 配列に変換します。

newStr = joinWords(documents,delim) は、スペースの代わりに区切り文字 delim を使用して単語を連結します。

すべて折りたたむ

単語をスペースで連結して、tokenizedDocument 配列を string 配列に変換します。

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"

単語をアンダースコアで連結して、tokenizedDocument 配列を string 配列に変換します。

str = joinWords(documents,"_")
str = 2x1 string
    "an_example_of_a_short_sentence"
    "a_second_short_sentence"

入力引数

すべて折りたたむ

入力文書。tokenizedDocument 配列として指定します。

単語を連結する区切り記号。string スカラー、文字ベクトル、または文字ベクトルを含むスカラー cell 配列として指定します。

例: "_"

例: '_'

例: {'_'}

データ型: char | string | cell

出力引数

すべて折りたたむ

出力テキスト。string 配列として返されます。

データ型: string

バージョン履歴

R2017b で導入