主要内容

removeLongWords

从文档或单词袋模型中删除长单词

描述

例子

newDocuments= removeLongWords (文档len删除长度的单词len或者大于文档

例子

newBag= removeLongWords (len删除长度的单词len或者更大bagOfWords对象

例子

全部折叠

从文档中删除七个或更多字符的单词。

文档= tokenizedDocument("一个短句的例子");newDocument = removeLongWords(文档,7)
newDocument = tokenizedDocument: 4个token:一个short的An

从单词袋模型中删除七个或更多字符的单词。

documents = tokenizedDocument([...一个短句的例子。“第二个短句”]);bag = bagOfWords(文档);newBag = removeLongWords(包,7)
newBag = bagOfWords with properties:计数:[2x5 double]词汇:["an" "a" "short" "second"] NumWords: 5 NumDocuments: 2

输入参数

全部折叠

输入文档,指定为tokenizedDocument数组中。

输入单词袋模型,指定为bagOfWords对象。

要删除的单词的最小长度,指定为正整数。该函数删除带有的单词len或者更伟大的人物。

输出参数

全部折叠

输出文档,返回为tokenizedDocument数组中。

输出单词袋模型,返回为bagOfWords对象。

版本历史

在R2017b中引入