📜 ⬆️ ⬇️

Installing NetBeans Spell Check Dictionaries

Hello!

What we want


We want NetBeans spell checking for the Russian language to work.

How to make


KO: For the Russian language spell check to work, you need to install a dictionary for the Russian language!
')
Since I could not find the dictionary at once, I had to make it myself. Under the cut a story how to make your dictionary for NetBeans. For those who do not want to fool around, at the end of the article are links to ready-made dictionaries.

UPDATE
The comments confirmed the operability of dictionaries in IntelliJ IDEA and Eclipse IDE.



All actions were performed under Ubuntu 11.04 with aspell installed. Dictionaries were tested in NetBeans 7.1beta, but should work successfully in versions 6.9 and 7.0.

Download and install the Russian dictionary

Download and install the Russian 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 NetBeans dictionary

The NetBeans dictionary is just a list of words. We need to generate it from the aspell dictionary.
To see the installed aspell dictionaries, run the command:
 aspell dump dicts 

In this list we should see dictionaries for the Russian language:
ru-ye - dictionary with words through "e", for example, contains "tree"
ru-yo - dictionary with words through "e", for example, contains "Christmas tree"
ru-yeyo - dictionary with words through "e" and "e", contains "fir-tree" and "fir-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 the aspell_dump-ru-yo.txt file containing all the words from the dictionary with different endings.

Why did you get me English? Let's do back for!

Unfortunately, NetBeans does not support multiple dictionaries at the same time. If you write poems or memoirs to NetBeans, then maybe you only need to check the Russian language. If sometimes you also program, you also need to check English. To do this, create a combined 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 Tools -> Options -> Miscellaneous -> Spellchecker tab.
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 “ru” locale.
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 be used only when the dictionary locale exactly matches the default locale.
Close the dialog and go to the editor. Open any file, write the word in Russian and save. NetBeans will launch the spell checker, which for the first time will generate an index from our dictionary. Therefore, do not rush and wait.
Dictionary indices are stored in the ~ / .netbeans / 7.1beta / var / cache / dict / folder. For our dictionary, the file dictionary_ru.trie1 should appear.
When you delete a dictionary from NetBeans, the index file is not deleted, you must delete it manually.

Thanks for attention!

Links

For those who are too lazy to do everything on their own, I prepared two dictionaries:

Combined dictionary of English and Russian with the writing of words through "e"
Combined dictionary of English and Russian with the writing of words through "e"

UPD: At the request of workers
English Dictionary
Dictionary of the Russian language with the spelling of words through "e"
Dictionary of the Russian language with the spelling of words through "e"

Source: https://habr.com/ru/post/133552/


All Articles