How do I edit .dic files?

For simplicity I want to combine 4 custom language .dic files into one file. How can I do this, and what is the limit of entries in a single .dic file in LibreOffice?
[I’m using LibreOffice 3.4.4 in Linux Mint 12, Gnome 3.2.1]

Thank you Manj_k,
This has worked, and in 5 minutes my four user defined dictionaries were combined into one, and works faster and seems to bring up more complete lists in the correction option pop-up menu. BTW the single new file, has 7,800 entries.

Below is the file format:

OOoUserDict1
lang: <none>
type: positive
---

[my list of words are here, A-Z sorted, no spaces allowed, just word and return.]
Note lang:

If you are referring to user-defined dictionaries "xyz.dic"
(path: .../user/wordbook) in user-editable "OOoUserDict1" format,
e.g. Language English (USA):

OOoUserDict1
lang: en-US
type: positive
---
[...]

(1) Open the "*.dic" files with a text editor, and copy/paste the word lists in a single "sample.txt" file (flat UTF-8).

(2) Sort the content: alphanumeric, ascending (you may use Writer, menu "Tools → Sort").

(3) Add the encoding lines at the beginning (“OOoUserDict1…”, see above).

(4) Save the file, rename it to "sample.dic", add "sample.dic" to .../user/wordbook.

(5) Open Writer, check menu `Tools → Options → Language Settings → Writing Aids → User-defined dictionaries → :ballot_box_with_check: sample [English (USA)].

See also (OOo) → Bug 106032 - linguistic: make human-readable user-dicts the default format?

As far as I can see in → Bug 48676 - Remove or expand limitation on User dictionary, the limit of entries in a user-defined dictionary has the value 30,000.

EDIT 2012-09-21

Thanks @Yohane,

the dictionary format for “Language: [All]”:

OOoUserDict1
lang: <none>
type: positive
---
[...]

Hi,
Sorry but my newly created sample.dic does not appear in menu `Tools → Options → Language Settings → Writing Aids → User-defined dictionaries although I closed and re-opened LibreOffice
Could you help ? Thanks [I’m using LibreOffice 4.1.1.2 in windows 7]

@durecu

Do you have closed the quickstarter (if enabled)?

Does it work for you with this sample_all.dic?

Could you upload your sample.dic for testing?

No Quickstarter. Sorry i don’t know how to upload…
I progressed since yesterday but still no result: Opened a new Writer doc. Typed a non-dictionary word ‘Gouby’.Went to Tools/Spelling /Options/New, created TestGoub2 [All]. Added Gouby to TestGoub2… Went to Wordbook file, Click on TestGoub Edit. It opened with Notepad. Take out Gouby replaced by another word ‘mungeasmes’. Saved. Closed.
Here is how EditGoub looks:

OOoUserDict1
lang: <none>
type: positive
---
mungeasmes

Then I open a new writer doc, go Tools / Options / Language Settings / writing aids / User defined
Now I can see TestGoub2 and it is ticked. However if I choose Edit, it shows as being empty.
Indeed if I type mungeasmes spellchecker sees it as incorrect .
Thanks for your support.

Hi, No quickstarter that I know. Managed to create a dic TestGoub2 that shows in Tools → Options → Language Settings → Writing Aids → User-defined dictionaries (ticked). However the only word I input in the file does not show and indeed spell checker sees it as wrong word.
Here is TestGoub2:

OOoUserDict1
lang: <none>
type: positive
---
mungeasmes

Thanks for your support

@durecu

I’ve followed your described steps, and all works fine for me (LO 4.1.2.2 on Win7-64b).

Here you can see my final TestGoub2.dic.

And that’s the download link for my TestGoub2.dic.

Maybe related bug reports: fdo#53611 · fdo#60870 ?

@manj_k
Thank you, it works now. Final question: How do I disable the French dic so that only the words not in my TestGoub2 will be flagged. I have tried Tools → Options → Language Settings → None, but then no spell check is done. For the time being I declare that language is Finnish, which flags most French words, but there must be a better way.

@durecu

As far as I understand your intention: You want to use French as text language, and also French spell check. But only the words of your TestGoub2.dic should not be marked as misspelled.

A related thread: Create Basic English dictionary.

A tested workaround in my following comment(s) – using a decreased fr.dic. […]

[…]

Close all instances of LibreOffice.

Select the French dictionary fr.dic in your LibreOffice program folder

(Path: …\Program Files (x86)\LibreOffice 4\share\extensions\dict-fr).

Rename fr.dic to fr.dic.bak (as a backup).

Edit a copy of fr.dic.bak in a text editor as follows:

Remove all the content except the first two lines, and change the first line to 1 (= number of items):

Before:

74225

& 200

After:

1

& 200

[…]

[…]

Rename this decreased fr.dic.bak to fr.dic and add it to the folder dict-fr.

(Create a backup of the decreased fr.dic – it will be replaced by an update of LibreOffice.)

Restart LibreOffice …

You can toggle both French dictionaries (complete or decreased) by renaming them.

Screenshot: https://dl.dropboxusercontent.com/u/19264180/LibO/decreased-fr-dict.png

@manj_k
I will try that, Many many thanks. Besides, now I understand better why my sample.dic files couldn’t be found. First I have to restart the PC, not only Libreoffice, for them to be shown. Second when I saved with UTF-8 encoding, they are not seen. They need to be encoded with ANSI. However I still have a difficulty the words with a french accent (é, à) which are not recognised in my special dictionary…

@durecu – You could use Notepad++ as text editor, and apply encoding UTF-8 without BOM.

Screenshot: https://dl.dropboxusercontent.com/u/19264180/LibO/utf-8-wo-bom.png

Download enhanced sample TestGoub2.dic

Great, it works. Many thanks for your patience. Cheers,