在 Windows 10 中安装 Wordnet 模块 perl

Installing Wordnet module perl in Windows 10

我使用了命令

cpanm WordNet::Similarity

第一次使用包安装依赖项时产生错误

WordNet::QueryData 和此错误消息似乎描述了问题

* Please set the WNHOME environment variable to the location of your WordNet installation. QueryData.pm will not work otherwise. Alternatively, you can make the installation in the default * location, C:\Program Files\WordNet.0 on Windows, or /usr/local/WordNet-3.0 on unix.

我下载了 windows 版本 2.1 的最新版本,我将其安装在 C:\Program Files (x86)\WordNet.1

第一个问题是它们的名称不同,所以安装不可能找到这个位置

并且建议的解决方案是设置

WNHOME environment variable (specifying the WordNet installation directory).

如何设置WNHOME?因为我在环境变量中设置了PATH到位置,我有同样的问题

很简单,不是PATH,而是必须新建一个变量WNHOME(例如C:\Program Files\WordNet.1)是wordnet文件夹(WN) ) 和字典的另一个变量 WNSEARCHDIR ex: C:\Program Files\WordNet.1\dict