如何在 Eclipse 中安装平台字典

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4374210/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:47:20  来源:igfitidea点击:

How to install a platform dictionary in Eclipse

eclipsedictionaryspell-checking

提问by bluish

For spell checking purpose I would like to install an addictional "platform dictionary" in my Eclipse IDE.

出于拼写检查的目的,我想在我的 Eclipse IDE 中安装一个令人上瘾的“平台字典”。

You can see the list of platform dictionaries installed in Window > Preferences > General > Editors > Text Editors > Spelling, in the field "Platform dictionary". In my Helios Service Release 1 there are only english of UK or USA. I would to put the language of my country, so I can write comments in my language and have spell check. Eclipse help doesn't explain how.

您可以在“平台词典”字段中查看安装在“窗口”>“首选项”>“常规”>“编辑器”>“文本编辑器”>“拼写”中的平台词典列表。在我的 Helios Service Release 1 中,只有英国或美国的英语。我想输入我国家的语言,这样我就可以用我的语言写评论并进行拼写检查。Eclipse 帮助没有解释如何。

采纳答案by VonC

I am not sure you can add a "Platform dictionary", so that leaves you with a "user defined" one:

我不确定您是否可以添加“平台词典”,这样您就可以使用“用户定义”词典:

alt text

替代文字

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.

Eclipse 支持“字典”文件的标准每行一个字格式。
您可以在 Sourceforge.net上的Kevin's Word List 中找到其中的几个,包括指向其他​​站点的链接。

回答by Konrad Nowicki

If you can't find your language word list you can generate one using aspell.

如果您找不到您的语言单词列表,您可以使用 aspell 生成一个。

aspell --lang=pl dump master | aspell --lang=pl expand | tr ' ' '\n' > pl.dict

In Ubuntu aspell generates list in UTF-8 in other systems you can add encoding option.

在 Ubuntu aspell 在其他系统中生成 UTF-8 列表中,您可以添加编码选项。

--encoding=utf-8

回答by Alex Schr?der

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.

如果你找不到好的 worldlist 并且不能运行 aspell,你也可以从 Debian 获取 wordlist。在 Windows 上,我使用了Swiss German wordlist。点击所有,选择一个镜像,下载.deb文件,使用7-zip或类似文件打开它,打开里面的data.tar,找到你要找的文件。就我而言,它是/usr/share/dict/swiss.

回答by propatience

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:

感谢@VonC、@Konrad Nowicki 和@Alex Schr?der 的早期答案。我没有发现其他答案完全令人满意,所以我想写下我自己的答案。你的问题:

How to install a platform dictionary in Eclipse?

如何在 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 change swedishto whatever language you're looking for a dictionary and I hope you'll find a txtdictionary) 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 in UTF-8and have EOL (End of lines) characters Unix (LF)it should be fine. However, if it isn't formatted as UTF-8you'll have to convert the ???ü characters to reflect the UTF-8standard, example program for this: Notepad++. If the dictionary has another EOL characters: Windows (CR LF)or Macintosh (CR), then just convert it to Unix (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.txtor ~/eclipse/dictionary.txtdepending on where you installed Eclipse. Restart Eclipseand it should work.

下载单词的文本文件。我下载单词文件的方法:我用谷歌搜索swedish word list txt(只需更改swedish为您正在寻找字典的任何语言,我希望您能找到txt字典)并找到了这个(此链接于 2018-09-25 有效)GitHub repo with瑞典语词典:https: //github.com/martinlindhe/wordlist_swedish。只要您的字典文件格式正确UTF-8并具有 EOL(行尾)字符,Unix (LF)它应该没问题。但是,如果它没有格式化,因为UTF-8您必须转换 ???ü 字符以反映UTF-8标准,示例程序:Notepad++。如果字典有另一个 EOL 字符: Windows (CR LF)or Macintosh (CR),那么只需将其转换为Unix (LF),为此的示例程序:Notepad++。然后打开一个文本编辑器,示例程序:Notepad++,将新词典附加到您的自定义词典所在的位置,通常%userprofile%/eclipse/dictionary.txt~/eclipse/dictionary.txt取决于您安装的位置Eclipse。重新启动Eclipse,它应该可以工作。