Ask Your Question
1

How do I edit .dic files? [closed]

asked 2012-09-20 23:21:54 +0100

Yohane gravatar image

updated 2015-10-22 23:34:22 +0100

Alex Kemp gravatar image

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]

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-10-22 23:33:56.645513

2 Answers

Sort by » oldest newest most voted
0

answered 2012-09-21 17:39:24 +0100

manj_k gravatar image

updated 2012-09-21 22:15:04 +0100

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 → ☑ 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
---
[...]
edit flag offensive delete link more

Comments

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 gravatar imagedurecu ( 2013-09-19 10:51:56 +0100 )edit

@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?

manj_k gravatar imagemanj_k ( 2013-09-19 23:41:17 +0100 )edit

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.

durecu gravatar imagedurecu ( 2013-09-20 12:37:24 +0100 )edit

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 gravatar imagedurecu ( 2013-09-20 12:44:26 +0100 )edit

@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 gravatar imagemanj_k ( 2013-09-20 18:33:30 +0100 )edit

@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 gravatar imagedurecu ( 2013-09-21 04:07:59 +0100 )edit

@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. [...]

manj_k gravatar imagemanj_k ( 2013-09-21 10:43:27 +0100 )edit

[...]

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

[...]

manj_k gravatar imagemanj_k ( 2013-09-21 10:49:15 +0100 )edit

[...]

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 gravatar imagemanj_k ( 2013-09-21 11:04:20 +0100 )edit

@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 gravatar imagedurecu ( 2013-09-21 15:40:36 +0100 )edit
1

answered 2012-09-21 21:09:23 +0100

Yohane gravatar image

updated 2013-09-21 11:08:04 +0100

manj_k gravatar image

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: <none>

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-09-20 23:21:54 +0100

Seen: 5,741 times

Last updated: Sep 21 '13