在 R 中加载 wordnet 包时出现问题
我在将 wordnet 加载到 R 中时遇到问题。我使用 R x64 2.14.1。我安装了 wordnet 包,然后尝试加载该包。
> library(wordnet)
Warning message:
In initDict() :
cannot find WordNet 'dict' directory: please set the environment variable WNHOME to its parent
怎么了?我应该如何设置 WNHOME 目录以及设置什么内容。
I have trouble loading wordnet into R. I use R x64 2.14.1. I installed the package wordnet and then I tried to load the package.
> library(wordnet)
Warning message:
In initDict() :
cannot find WordNet 'dict' directory: please set the environment variable WNHOME to its parent
What is wrong? How and to what should I set the directory WNHOME.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您需要设置字典路径。请参见下面的示例。
此外,我在使用 R-studio 时遇到了问题,所以我被迫使用 JGR。
You need to set the dictionary path. See example below.
Further I had problems using R-studio so I was forced to use JGR.
数据必须单独安装。
如果你在Linux上,只需安装“wordnet”包(在Windows上,它会更手动)。
The data has to be installed separately.
If you are on Linux, just install the "wordnet" package (on Windows, it will be more manual).
这很好用。我们需要使用 Sys.setenv() 将 WNHOME 设置为 dict 的父目录,即 R 中的 ./WordNet/2.1
This works fine. We need to set WNHOME to dict's parent directory which is ./WordNet/2.1 from R using Sys.setenv()
我遇到了这个问题,并通过从 http://wordnetcode.princeton 下载并安装 wordnet 解决了它。 edu/2.1/WordNet-2.1.exe
然后重新运行
I had this problem and solved it by downloading and installing wordnet from http://wordnetcode.princeton.edu/2.1/WordNet-2.1.exe
and then rerunning
我在 Windows 上的 R 中调用库“wordnet”时遇到了同样的问题。
然后经过多次不成功的尝试,我从这个网站下载了WordNet_2.1.exe文件 https://en.freedownloadmanager.org/users-choice/Wordnet_2.1.html。
下载后,您可以直接在 R 中设置路径并继续,无需进一步中断。对我来说这有效:
尝试一下!
I was facing the same problem while calling the library "wordnet" in R on Windows.
Then after many unsuccessful trials,I downloaded the WordNet_2.1.exe file from this site https://en.freedownloadmanager.org/users-choice/Wordnet_2.1.html.
After downloading this,you can directly set path in R and proceed with no further interuptions. For me this worked:
Try it!!