No changes when using function erasePunctuation to remove digits.
1 回表示 (過去 30 日間)
古いコメントを表示
I'm trying to remove the digits in my document that has been tokenized.
However, using the erasePunctuation function, I didn't see any changes (no digits were removed) to the updated document. I've checked the type, and the tokenizer does recognize these tokens as digits. Please help. Thanks.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/552387/image.jpeg)
The output:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/552392/image.jpeg)
0 件のコメント
回答 (1 件)
Cris LaPierre
2021 年 3 月 16 日
編集済み: Cris LaPierre
2021 年 3 月 16 日
erasePunctuation still only erases punctuation, not numbers. The 'digits' specification tells it what type of token to remove punctuation from. See the description here.
You could try to remove digits using the following.
tkD = tokenDetails(cleanDoc);
cleanDoc = removeWords(cleanDoc,tkD{tkD.Type=="digits"});
参考
カテゴリ
Help Center および File Exchange で Text Data Preparation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!