MATLAB ヘルプ センター
このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
文書配列内の文書の長さ
N = doclength(documents)
N = doclength(documents) は、documents 内の各文書のトークン数を返します。
N
documents
例
すべて折りたたむ
トークン化された文書の配列内の単語数を検出します。句読点を消去して、単語としてカウントされないようにします。
str = [ ... "An example of a short sentence." "A second short sentence."]; documents = tokenizedDocument(str)
documents = 2×1 tokenizedDocument: 7 tokens: An example of a short sentence . 5 tokens: A second short sentence .
documents = erasePunctuation(documents)
documents = 2×1 tokenizedDocument: 6 tokens: An example of a short sentence 4 tokens: A second short sentence
N = 2×1 6 4
tokenizedDocument
入力文書。tokenizedDocument 配列として指定します。
文書の長さ。非負の整数のベクトルとして返されます。N のサイズは documents のサイズと同じになります。
R2017b で導入
context | doc2cell | joinWords | string | tokenizedDocument
context
doc2cell
joinWords
string
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
ヨーロッパ
アジア太平洋地域
最寄りの営業オフィスへのお問い合わせ