gpt4 book ai didi

macos - 用于 mac 的 bash shell 脚本从文件生成单词列表?

转载 作者:行者123 更新时间:2023-11-29 09:11:31 24 4
gpt4 key购买 nike

是否有一个在 mac 上运行的 shell 脚本来从文本文件生成单词列表,列出唯一的单词?如果它可以按频率排序就更好了....

抱歉忘了说,是的,我更喜欢 bash,因为我现在使用的是 mac...

哦,我的文件是法语的...(基本上我正在读一本小说并学习法语,所以我试着自己生成一个单词列表)。希望这不是问题?

最佳答案

如果我没理解错的话,你需要这样的东西:

cat <filename> | sed -e 's/ /\n/g' | sort | uniq -c

关于macos - 用于 mac 的 bash shell 脚本从文件生成单词列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10386280/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com