Install Spellcheck Dictionaries in NetBeans
What do we want
We want NetBeans spelling checker to work for Russian.
How to do
KO: For the spelling checker to work for the Russian language, you need to install a dictionary for the Russian language!
Since the dictionary could not be found right away, I had to do it myself. Under a cat the story how to make the dictionary for NetBeans. For those who do not want to fool, at the end of the article are links to ready-made dictionaries.
UPDATE
The comments confirmed the functionality of the dictionaries in IntelliJ IDEA and Eclipse IDE.
All actions were performed under Ubuntu 11.04 with aspell installed. Dictionaries were checked in NetBeans 7.1beta, but should work successfully in versions 6.9 and 7.0.
Download and install the Russian language dictionary
Download and install the Russian language dictionary for aspell. If you need a dictionary for another language - look here ftp.gnu.org/gnu/aspell/dict/0index.html
mkdir -p /tmp/nbdict && cd /tmp/nbdict
wget ftp://ftp.gnu.org/gnu/aspell/dict/ru/aspell6-ru-0.99f7-1.tar.bz2
tar -jxf aspell6-ru-0.99f7-1.tar.bz2
cd aspell6-ru-0.99f7-1/
./configure
# Здесь мы должны увидеть что-то типа этого:
# Finding Dictionary file location ... /usr/lib/aspell
# Finding Data file location ... /usr/lib/aspell
make
sudo make install
Generating a dictionary for NetBeans
A dictionary for NetBeans is just a list of words. We need to generate it from the aspell dictionary.
To see the installed aspell dictionaries, you must run the command:
aspell dump dicts
In this list we should see dictionaries for the Russian language:
ru-ye - a dictionary with words through "e", for example contains a "Christmas tree"
ru-yo - a dictionary with words through "e", for example contains a "Christmas tree"
ru-yeyo - dictionary with words through "e" and "e", contains "tree" and "tree"
ru - contains the same as ru-ye
We need to generate a dictionary file of Russian words with all forms of word endings (word suffixes), one word on each line:
cd ..
aspell -l ru-yo dump master | aspell -l ru expand | tr ' ' '\n' > aspell_dump-ru-yo.txt
# aspell -l ru-yo dump master - получить список слов словаря ru-yo
# aspell -l ru expand - развернуть окончания (суффиксы) слов по правилам русского языка
# tr ' ' '\n' - разбить вывод предыдущей команды на строки
Now we have an aspell_dump-ru-yo.txt file containing all the words from the dictionary with different endings.
Why did you cut me English? Let's do it back, for!
Unfortunately, NetBeans does not support multiple dictionaries at the same time. If you write poems or memoirs in NetBeans, then maybe only checking the Russian language is enough for you. If you sometimes program, you also need to check English. To do this, create a joint dictionary of words in Russian and English:
# Генерируем словарь для английского
aspell -l en_US dump master | aspell -l en expand | tr ' ' '\n' > aspell_dump-en_US.txt
# Объединяем словари
cat aspell_dump-en_US.txt aspell_dump-ru-yo.txt > aspell_dump-en_US+ru-yo.txt
Install the dictionary
Launch NetBeans, open the tab Tools -> Options -> Miscellaneous -> Spellchecker.
On the tab, click Add ... and select our file aspell_dump-en_US + ru-yo.txt. Set the encoding of the dictionary in UTF-8 and enter the locale “ru”.
Click Add - the dictionary should appear in the list. To check the spelling of the Russian language, select the default locale "ru". The dictionary will only be used when the locale of the dictionary exactly matches the default locale.
Close the dialog and go to the editor. We open any file, write the word in Russian and save. NetBeans will launch the spellchecking process, which for the first time will generate an index from our dictionary. Therefore, do not rush and wait.
Dictionary indexes are stored in the ~ / .netbeans / 7.1beta / var / cache / dict / folder. For our dictionary, the dictionary_ru.trie1 file should appear.
When you delete a dictionary from NetBeans, the index file is not deleted; you must manually delete it.
Thanks for attention!
References
For those who are too lazy to do everything on their own, I prepared two dictionaries: A
joint dictionary of English and Russian languages with spelling words through “ё” A
joint dictionary of English and Russian languages with spelling words through “e”
UPD: At the request of workers
English
dictionary Russian language dictionary with spelling words through "e"
Dictionary of Russian language with spelling words through "e"