如何在 Eclipse 中安装平台字典
为了进行拼写检查,我想在 Eclipse IDE 中安装一个令人上瘾的“平台字典”。
您可以在Window > 中看到已安装的平台词典列表。首选项>一般>编辑>文本编辑器>拼写,在“平台词典”字段中。在我的 Helios Service Release 1 中,只有英国或美国英语。我想输入我所在国家的语言,这样我就可以用我的语言写评论并进行拼写检查。 Eclipse 帮助没有解释如何操作。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您找不到您的语言单词列表,您可以使用 aspell 生成一个。
在 Ubuntu 中,aspell 会生成 UTF-8 格式的列表,在其他系统中,您可以添加编码选项。
If you can't find your language word list you can generate one using aspell.
In Ubuntu aspell generates list in UTF-8 in other systems you can add encoding option.
我不确定您是否可以添加“平台字典”,这样您就可以得到一个“用户定义”字典:
Eclipse 支持“字典”文件的标准每行一个字格式。
您可以在 Sourceforge.net 上的凯文单词列表上找到其中的几个,包括链接到其他网站。
I am not sure you can add a "Platform dictionary", so that leaves you with a "user defined" one:
Eclipse supports a standard one-word-per-line format for the 'dictionary' file.
You can have several of those at Kevin's Word List on Sourceforge.net, including links to other sites.
如果您找不到好的世界列表并且无法运行 aspell,您还可以从 Debian 获取单词列表。在 Windows 上,我使用了瑞士德语单词列表。点击全部,选择一个镜像,下载.deb文件,使用7-zip或类似的打开它,打开里面的data.tar,找到你要找的文件。就我而言,它是
/usr/share/dict/swiss
。If you can't find a good worldlist and can't run aspell, you can also get wordlists from Debian. On Windows, I used the Swiss German wordlist. Klick all, pick a mirror, download the .deb file, use 7-zip or similar to open it, open the data.tar inside, and find the file you are looking for. In my case it was
/usr/share/dict/swiss
.感谢@VonC、@Konrad Nowicki 和@Alex Schröder 之前的回答。我发现其他答案并不完全令人满意,所以我想写下自己的答案。您的问题:
如何在 Eclipse 中安装平台字典?
对于英语:
既然您提到包含美国和英国英语,则无需解释。
对于非英语语言,例如带有 åäöü 等奇怪字符的语言,这里的示例是瑞典语(经过测试并且有效):
下载单词的文本文件。我下载单词文件的方法:我用谷歌搜索了
swedish word list txt
(只需将swedish
更改为您要查找字典的任何语言,我希望您能找到一个txt
字典)并找到了这个(此链接于 2018 年 9 月 25 日有效)带有瑞典语字典的 GitHub 存储库:https://github.com/martinlindhe/wordlist_swedish。只要您的字典文件的格式正确为UTF-8
并具有 EOL(行尾)字符Unix (LF)
就应该没问题。但是,如果它的格式不是UTF-8
,则必须转换 åäöü 字符以反映UTF-8
标准,示例程序如下:记事本++
。如果字典还有其他 EOL 字符:Windows (CR LF)
或Macintosh (CR)
,则只需将其转换为Unix (LF)
,示例程序:Notepad++
。然后打开一个文本编辑器,示例程序:Notepad++
,将新词典附加到它所在的自定义词典中,通常是%userprofile%/eclipse/dictionary.txt 或
~/eclipse/dictionary.txt
取决于您安装Eclipse
的位置。重新启动 Eclipse,它应该可以工作。Thank you @VonC, @Konrad Nowicki and @Alex Schröder for the earlier answers. I didn't find the other answers fully satisfying so I wanted to write my own answer. Your question:
How to install a platform dictionary in Eclipse?
For English:
Since you mentioned that US and UK English is included, no need to explain.
For non-English languages, like languages with strange characters like åäöü, example here is Swedish (tested and it works):
Download a text file of the words. My method for downloading a file of words: I googled
swedish word list txt
(just changeswedish
to whatever language you're looking for a dictionary and I hope you'll find atxt
dictionary) and found this (this link worked 2018-09-25) GitHub repo with an Swedish dictionary: https://github.com/martinlindhe/wordlist_swedish. As long as your dictionary file is formatted correctly inUTF-8
and have EOL (End of lines) charactersUnix (LF)
it should be fine. However, if it isn't formatted asUTF-8
you'll have to convert the åäöü characters to reflect theUTF-8
standard, example program for this:Notepad++
. If the dictionary has another EOL characters:Windows (CR LF)
orMacintosh (CR)
, then just convert it toUnix (LF)
, example program for this:Notepad++
. Then open a text editor, example program for this:Notepad++
, to append the new dictionary to your custom dictionary where it is located, often times%userprofile%/eclipse/dictionary.txt
or~/eclipse/dictionary.txt
depending on where you installedEclipse
. RestartEclipse
and it should work.