blob: 9fc3fd1efb38c3ad1f48a8d154fbe1bbb1ace132 [file] [log] [blame]
Bram Moolenaar402d2fe2005-04-15 21:00:38 +00001The spell files included here are in Vim's special format. You can't edit
2them. See ":help spell" for more information.
3
4
Bram Moolenaar53180ce2005-07-05 21:48:14 +00005COPYRIGHT
Bram Moolenaar402d2fe2005-04-15 21:00:38 +00006
7The files used as input for the spell files come from the OpenOffice.org spell
8files. Most of them go under the LGPL or a similar license.
9
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +000010Copyright notices for specific languages are in README_??.txt. Note that the
11files for different regions are merged, both to save space and to make it
12possible to highlight words for another region different from bad words.
Bram Moolenaar53180ce2005-07-05 21:48:14 +000013
Bram Moolenaarf25fd512005-09-30 21:15:37 +000014Most of the soundslike mappings come from Aspell ??_phonet.dat files:
15ftp://ftp.gnu.org/gnu/aspell/dict/. Most go under the GPL or LGPL copyright.
16
Bram Moolenaar53180ce2005-07-05 21:48:14 +000017
18GENERATING .SPL FILES
19
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010020This involves downloading the files from the github server, applying a
Bram Moolenaar53180ce2005-07-05 21:48:14 +000021patch and running Vim to generate the .spl file. To do this all in one go use
22the Aap program (www.a-a-p.org). It's simple to install, it only requires
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010023Python (http://www.a-a-p.org/download.html)
Bram Moolenaar53180ce2005-07-05 21:48:14 +000024
Bram Moolenaar62292582010-07-10 16:36:59 +020025Before generating spell files, verify your system has the required locale
26support. Source the check_locales.vim script to find out. If something is
27missing, see LOCALE below.
28
29
Bram Moolenaar53180ce2005-07-05 21:48:14 +000030You can also do it manually:
311. Fetch the right spell file from:
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010032 https://github.com/LibreOffice/dictionaries
Bram Moolenaar53180ce2005-07-05 21:48:14 +000033
342. Unzip the archive:
35 unzip LL_RR.zip
36
373. Apply the patch:
38 patch < LL_RR.diff
39
404. If the language has multiple regions do the above for each region. E.g.,
41 for English there are five regions: US, CA, AU, NZ and GB.
42
435. Run Vim and execute ":mkspell". Make sure you do this with the correct
44 locale, that influences the upper/lower case letters and word characters.
45 On Unix it's something like:
46 env LANG=en_US.UTF-8 vim
47 mkspell! en en_US en_AU en_CA en_GB en_NZ
48
496. Repeat step 5 for other locales. For English you could generate a spell
50 file for latin1, utf-8 and ASCII. ASCII only makes sense for languages
51 that have very few words with non-ASCII letters.
52
53Now you understand why I prefer using the Aap recipe :-).
54
55
56MAINTAINING A LANGUAGE
57
58Every language should have a maintainer. His tasks are to track the changes
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010059in the spell files and make updated patches. Words that haven't been
60added/removed from the LibreOffice lists can also be handled by the patches.
Bram Moolenaar53180ce2005-07-05 21:48:14 +000061
62It is important to keep the version of the .dic and .aff files that you
Bram Moolenaar2a953fc2019-01-26 17:41:47 +010063started with. When LibreOffice brings out new versions of these files you can
Bram Moolenaar53180ce2005-07-05 21:48:14 +000064find out what changed and take over these changes in your patch. When there
65are very many changes you can do it the other way around: re-apply the changes
66for Vim to the new versions of the .dic and .aff files.
67
68This procedure should work well:
69
701. Obtain the zip archive with the .aff and .dic files. Unpack it as
71 explained above and copy (don't rename!) the .aff and .dic files to
72 .orig.aff and .orig.dic. Using the Aap recipe should work, it will make
73 the copies for you.
74
752. Tweak the .aff and .dic files to generate the perfect .spl file. Don't
76 change too much, the OpenOffice people are not stupid. However, you may
77 want to remove obvious mistakes. And remove single-letter words that
78 aren't really words, they mess up the suggestions (English has this
Bram Moolenaar5c736222010-01-06 20:54:52 +010079 problem). You can use the "fixdup.vim" Vim script to find duplicate words.
Bram Moolenaar53180ce2005-07-05 21:48:14 +000080
Bram Moolenaar2a953fc2019-01-26 17:41:47 +0100813. Include needed parts from the aspell phonetic dictionary to the aff files. For
82 example add the relevant SAL lines to the .aff file (this is needed to make good
83 suggestions). The aspell dictionaries can be found here:
84 https://ftp.gnu.org/gnu/aspell/dict/0index.html
85
864. Make the diff file. "aap diff" will do this for you. If a diff would be
Bram Moolenaar53180ce2005-07-05 21:48:14 +000087 too big you might consider writing a Vim script to do systematic changes.
88 Do check that someone else can reproduce building the spell file. Send the
89 result to Bram for inclusion in the distribution. Bram will generate the
90 .spl file and upload it to the ftp server (if he can't generate it you will
91 have to send him the .spl file too).
92
Bram Moolenaar2a953fc2019-01-26 17:41:47 +0100935. When OpenOffice makes a new zip file available you need to update the
Bram Moolenaar53180ce2005-07-05 21:48:14 +000094 patch. "aap check" should do most of the work for you: if there are
95 changes the .new.dic and .new.aff files will appear. You can now figure
96 out the differences with .orig.dic and .orig.aff, adjust the .dic and .aff
97 files and finally move the .new.dic to .orig.dic and .new.aff to .orig.aff.
98
Bram Moolenaar2a953fc2019-01-26 17:41:47 +0100996. Repeat step 5. regularly.
Bram Moolenaar62292582010-07-10 16:36:59 +0200100
101
102LOCALE
103
104For proper spell file generation the required locale must be installed.
105Otherwise Vim doesn't know what are letters and upper-lower case differences.
106Modern systems use UTF-8, but we also generate spell files for 8-bit locales
107for users with older systems.
108
109On Ubuntu the default is to only support locales for your own language. To
110add others you need to do this:
111 sudo vim /var/lib/locales/supported.d/local
112 Add needed lines from /usr/share/i18n/SUPPORTED
113 sudo dpkg-reconfigure locales
114
115When using the check_locales.vim script, you need to exit Vim and restart it
116to pickup the newly installed locales.