获取文本文件中单词列表的字典定义的最简单方法
File1:
hello
world
我不知道从文本文件中提取单词列表、找到它们的定义并将它们粘贴到输出文本文件中的最佳方法。我一直在考虑使用 WordNet - 但不知道如何自动化该过程。
有谁有任何想法(也许是谷歌/API/linux应用程序)可以用来查找单词的定义,然后将它们粘贴到文本文件中?
文件2:
an expression of greeting; "every morning they exchanged polite hellos"
universe: everything that exists anywhere; "they study the evolution of the universe"; "the biggest tree in existence"
File1:
hello
world
I don't know the best method to extract a list of words from a text file, find their definitions and paste them into an output textfile. I've been thinking of using WordNet - but don't know how to automate the process.
Does anyone have any ideas (perhaps google/APIs/linux applications) that one could use to find the definitions of words with, and then paste them into a text file?
File2:
an expression of greeting; "every morning they exchanged polite hellos"
universe: everything that exists anywhere; "they study the evolution of the universe"; "the biggest tree in existence"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尽管 API 或库可能是可行的方法(此处'一些 Perl 的东西),下面的 Bash 脚本非常可能会给你一些想法:
如果你在文件中有一个单词列表,一个单词到一行,改变第一个
for
和上面脚本的最后done
行:Although an API or library is probably the way to go (here's some Perl stuff), the Bash script below, which is very rough might give you some ideas:
If you have a list of words in a file, one word to a line, change the first
for
and lastdone
lines of the script above to:请参阅字典 API 或库了解多种解决方案。
See Dictionary API or Library for several solutions.