Main Content

string

Convert scalar document to string vector

Description

example

words = string(document) converts a scalar tokenizedDocument to a string array of words.

Examples

collapse all

Convert a scalar tokenized document to a string array of words.

document = tokenizedDocument("an example of a short sentence")
document = 
  tokenizedDocument:

   6 tokens: an example of a short sentence

words = string(document)
words = 1x6 string
    "an"    "example"    "of"    "a"    "short"    "sentence"

Input Arguments

collapse all

Input document, specified as a scalar tokenizedDocument object.

Output Arguments

collapse all

Output words, returned as a string vector.

Version History

Introduced in R2017b