Remove the words with seven or greater characters from a bag-of-words model.
documents = tokenizedDocument([ ..."an example of a short sentence""a second short sentence"]);
bag = bagOfWords(documents);
newBag = removeLongWords(bag,7)
newBag =
bagOfWords with properties:
Counts: [2x5 double]
Vocabulary: ["an" "of" "a" "short" "second"]
NumWords: 5
NumDocuments: 2