DocumentationHelp CenterDocumentation
Length of documents in document array
N = doclength(documents)
example
N= doclength(documents)returns the number of tokens in each document indocuments.
N= doclength(documents)
N
documents
collapse all
Find the number of words in an array of tokenized documents. Erase the punctuation characters so they do not get counted as words.
str = [..."An example of a short sentence.""A second short sentence."]; documents = tokenizedDocument(str)
documents = 2x1 tokenizedDocument: 7 tokens: An example of a short sentence . 5 tokens: A second short sentence .
documents = erasePunctuation(documents)
documents = 2x1 tokenizedDocument: 6 tokens: An example of a short sentence 4 tokens: A second short sentence
N =2×16 4
tokenizedDocument
Input documents, specified as atokenizedDocumentarray.
Document lengths, returned as a vector of nonnegative integers. The size ofNis the same as the size ofdocuments.
context|doc2cell|joinWords|string|tokenizedDocument
context
doc2cell
joinWords
string
この例の変更されたバージョンがあります。編集された方の例を開きますか?
次の 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