我想使用停用词列表在文本文件中找到最常用的词。我已经有了这个代码:
tr -c '[:alnum:]' '[\n*]' < test.txt |
fgrep -v -w -f /usr/share/groff/current/eign |
sort | uniq -c | sort -nr | head -10 > test.txt
Run Code Online (Sandbox Code Playgroud)
来自旧帖子, 但我的文件包含以下内容:
240
21 ipsum
20 Lorem
11 Textes
9 Blindtexte
7 Text
5 F
5 Blindtext
4 Texte
4 Buchstaben
Run Code Online (Sandbox Code Playgroud)
第一个只是一个空格,在文本中它们是标点符号(如点),但我不想要这个,所以我必须添加什么?